diff --git a/app/[locale]/(protected)/supervisor/ticketing/[media_id]/layout.tsx b/app/[locale]/(protected)/supervisor/ticketing/[media_id]/layout.tsx new file mode 100644 index 00000000..de39c9b1 --- /dev/null +++ b/app/[locale]/(protected)/supervisor/ticketing/[media_id]/layout.tsx @@ -0,0 +1,9 @@ +export const metadata = { + title: "Ticketing", +}; + +const Layout = ({ children }: { children: React.ReactNode }) => { + return <>{children}; +}; + +export default Layout; diff --git a/app/[locale]/(protected)/supervisor/ticketing/[media_id]/page.tsx b/app/[locale]/(protected)/supervisor/ticketing/[media_id]/page.tsx new file mode 100644 index 00000000..48ca3e6a --- /dev/null +++ b/app/[locale]/(protected)/supervisor/ticketing/[media_id]/page.tsx @@ -0,0 +1,26 @@ +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import TicketingTable from "../components/table"; +import { useParams } from "next/navigation"; + +const TicketingPage = async () => { + + + return ( +
+ + +
+ {/*
+

Semua Ticket : 0

+
*/} + + +
+
+ ); +}; + +export default TicketingPage; diff --git a/app/[locale]/(protected)/supervisor/ticketing/components/table.tsx b/app/[locale]/(protected)/supervisor/ticketing/components/table.tsx index a8ceead5..0427ea81 100644 --- a/app/[locale]/(protected)/supervisor/ticketing/components/table.tsx +++ b/app/[locale]/(protected)/supervisor/ticketing/components/table.tsx @@ -16,6 +16,7 @@ import { } from "@/components/ui/dropdown-menu"; import { cn } from "@/lib/utils"; import FormDetailTicketing from "@/components/form/ticketing/ticketing-detail-form"; +import { useParams } from "next/navigation"; /** * TicketingLayout @@ -35,14 +36,15 @@ import FormDetailTicketing from "@/components/form/ticketing/ticketing-detail-fo type Issue = { id: string | number; title?: string; - source?: string; // e.g., "instagram", "facebook", "tiktok", "youtube", "comment" + source?: string; createdAt?: string; status?: string; timeAgo?: string; - // any other fields from API }; -export default function TicketingLayout() { +export default function TicketingTable() { + const params = useParams(); + const mediaId = params?.media_id; const [issues, setIssues] = React.useState([]); const [totalElements, setTotalElements] = React.useState(0); const [totalPages, setTotalPages] = React.useState(1); @@ -78,7 +80,7 @@ export default function TicketingLayout() { async function fetchData() { try { - const res = await ticketingPagination(search, pageSize, page - 1); + const res = await ticketingPagination(search, pageSize, page - 1, mediaId == 'all' ? "" : mediaId as string); const data = res?.data?.data; const content = data?.content || []; const mapped: Issue[] = content.map((it: any, idx: number) => ({ diff --git a/components/form/content/image-update-form.tsx b/components/form/content/image-update-form.tsx index dd87e2b3..4717ca3d 100644 --- a/components/form/content/image-update-form.tsx +++ b/components/form/content/image-update-form.tsx @@ -1742,6 +1742,117 @@ export default function FormImageUpdate() { ) : null} {files.length > 0 && ( +
+ +
+ {files.map((file: any) => ( +
+ {file.fileName} +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ ))} +
+
+ )} + {/* {files.length > 0 && (