From ade8b1b296f69c48b4379e0934bae9e40bb71530 Mon Sep 17 00:00:00 2001 From: Anang Yusman Date: Mon, 20 Jan 2025 14:45:54 +0800 Subject: [PATCH] feat:update communication internal --- .../content/video/components/columns.tsx | 7 +-- .../communication/internal-detail-form.tsx | 52 +++++++++++++++++++ components/form/content/image-detail-form.tsx | 3 +- .../form/schedule/press-conference-form.tsx | 13 ++--- components/form/task/task-detail-form.tsx | 6 ++- 5 files changed, 67 insertions(+), 14 deletions(-) diff --git a/app/[locale]/(protected)/contributor/content/video/components/columns.tsx b/app/[locale]/(protected)/contributor/content/video/components/columns.tsx index 399b44d7..409fe156 100644 --- a/app/[locale]/(protected)/contributor/content/video/components/columns.tsx +++ b/app/[locale]/(protected)/contributor/content/video/components/columns.tsx @@ -116,13 +116,10 @@ const columns: ColumnDef[] = [ "menunggu review": "bg-orange-100 text-orange-600", }; - // Mengambil `statusName` dari data API const status = row.getValue("statusName") as string; - const statusName = status?.toLocaleLowerCase(); // Ubah ke huruf kecil - - // Gunakan `statusName` untuk pencocokan + const statusName = status?.toLocaleLowerCase(); const statusStyles = - statusColors[statusName] || "bg-gray-100 text-gray-600"; + statusColors[statusName] || "bg-red-200 text-red-600"; return ( (); const [ticketReply, setTicketReply] = useState([]); + const [ticketInternal, setTicketInternal] = useState( + null + ); const [replyVisible, setReplyVisible] = useState(false); const [replyMessage, setReplyMessage] = useState(""); const [selectedPriority, setSelectedPriority] = useState(""); @@ -96,6 +114,7 @@ export default function FormDetailInternal() { async function initState() { if (id) { const response = await getTicketingInternalDetail(id); + setTicketInternal(response?.data?.data || null); setDetail(response?.data?.data); } } @@ -203,6 +222,7 @@ export default function FormDetailInternal() {

Ticket #{detail?.referenceNumber}

+ {ticketReply?.map((list) => (
@@ -229,6 +249,38 @@ export default function FormDetailInternal() {

{list.message}

))} + {ticketInternal && ( +
+
+ +
+

+ + {ticketInternal?.createdBy?.fullname} + {" "} + mengirimkan pesan untuk{" "} + + {ticketInternal?.sendTo?.fullname} + +

+

+ {`${new Date(ticketInternal?.createdAt).getDate()}-${ + new Date(ticketInternal?.createdAt).getMonth() + 1 + }-${new Date( + ticketInternal?.createdAt + ).getFullYear()} ${new Date( + ticketInternal?.createdAt + ).getHours()}:${new Date( + ticketInternal?.createdAt + ).getMinutes()}`} +

+
+
+

+ {htmlToString(ticketInternal.message)} +

+
+ )}
{detail !== undefined && ( diff --git a/components/form/content/image-detail-form.tsx b/components/form/content/image-detail-form.tsx index 0c2b48a9..5935a1ad 100644 --- a/components/form/content/image-detail-form.tsx +++ b/components/form/content/image-detail-form.tsx @@ -9,7 +9,7 @@ import { zodResolver } from "@hookform/resolvers/zod"; import * as z from "zod"; import Swal from "sweetalert2"; import withReactContent from "sweetalert2-react-content"; -import { useParams, useRouter } from "next/navigation"; +import { useParams } from "next/navigation"; import { Select, SelectContent, @@ -55,6 +55,7 @@ import { getCookiesDecrypt } from "@/lib/utils"; import { Icon } from "@iconify/react/dist/iconify.js"; import { error } from "@/lib/swal"; import dynamic from "next/dynamic"; +import { useRouter } from "@/i18n/routing"; const imageSchema = z.object({ title: z.string().min(1, { message: "Judul diperlukan" }), diff --git a/components/form/schedule/press-conference-form.tsx b/components/form/schedule/press-conference-form.tsx index 09a36efc..46ce45f7 100644 --- a/components/form/schedule/press-conference-form.tsx +++ b/components/form/schedule/press-conference-form.tsx @@ -167,10 +167,10 @@ export default function FormPressConference() { )}
-
+
-

Aktifkan fitur live streaming

+ {isLiveStreamingEnabled && ( -
+
)} -
+
-

DI SAMPAIKAN OLEH

+

DI SAMPAIKAN OLEH

diff --git a/components/form/task/task-detail-form.tsx b/components/form/task/task-detail-form.tsx index d2e59d3f..768b1c00 100644 --- a/components/form/task/task-detail-form.tsx +++ b/components/form/task/task-detail-form.tsx @@ -1119,6 +1119,7 @@ export default function FormTaskDetail() {
{audioFile && (
@@ -1277,6 +1278,7 @@ export default function FormTaskDetail() { {isRecording &&

Recording... {timer} seconds remaining

}{" "} {/* Display remaining time */}
+ {urlInputs.map((url: any, index: any) => (