diff --git a/app/[locale]/(protected)/contributor/content/audio/components/columns.tsx b/app/[locale]/(protected)/contributor/content/audio/components/columns.tsx index 58f69d01..dfa06d24 100644 --- a/app/[locale]/(protected)/contributor/content/audio/components/columns.tsx +++ b/app/[locale]/(protected)/contributor/content/audio/components/columns.tsx @@ -121,13 +121,13 @@ const useTableColumns = () => { "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 + const isPublish = row.original.isPublish; + const isPublishOnPolda = row.original.isPublishOnPolda; - // Gunakan `statusName` untuk pencocokan - const statusStyles = - statusColors[statusName] || "bg-gray-100 text-gray-600"; + const status = + isPublish || isPublishOnPolda ? "diterima" : "menunggu review"; + + const statusStyles = statusColors[status] || "bg-red-200 text-red-600"; return ( { statusStyles )} > - {status} {/* Tetap tampilkan nilai asli */} + {status} ); }, diff --git a/app/[locale]/(protected)/contributor/content/image/components/columns.tsx b/app/[locale]/(protected)/contributor/content/image/components/columns.tsx index 28e03f43..0407251d 100644 --- a/app/[locale]/(protected)/contributor/content/image/components/columns.tsx +++ b/app/[locale]/(protected)/contributor/content/image/components/columns.tsx @@ -125,10 +125,13 @@ const useTableColumns = () => { "menunggu review": "bg-orange-100 text-orange-600", }; - const status = row.getValue("statusName") as string; - const statusName = status?.toLocaleLowerCase(); - const statusStyles = - statusColors[statusName] || "bg-red-200 text-red-600"; + const isPublish = row.original.isPublish; + const isPublishOnPolda = row.original.isPublishOnPolda; + + const status = + isPublish || isPublishOnPolda ? "diterima" : "menunggu review"; + + const statusStyles = statusColors[status] || "bg-red-200 text-red-600"; return ( { statusStyles )} > - {status} {/* Tetap tampilkan nilai asli */} + {status} ); }, diff --git a/app/[locale]/(protected)/contributor/content/teks/components/columns.tsx b/app/[locale]/(protected)/contributor/content/teks/components/columns.tsx index 0a25137b..0b802b4f 100644 --- a/app/[locale]/(protected)/contributor/content/teks/components/columns.tsx +++ b/app/[locale]/(protected)/contributor/content/teks/components/columns.tsx @@ -122,13 +122,13 @@ const useTableColumns = () => { "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 + const isPublish = row.original.isPublish; + const isPublishOnPolda = row.original.isPublishOnPolda; - // Gunakan `statusName` untuk pencocokan - const statusStyles = - statusColors[statusName] || "bg-gray-100 text-gray-600"; + const status = + isPublish || isPublishOnPolda ? "diterima" : "menunggu review"; + + const statusStyles = statusColors[status] || "bg-red-200 text-red-600"; return ( { statusStyles )} > - {status} {/* Tetap tampilkan nilai asli */} + {status} ); }, diff --git a/app/[locale]/(protected)/contributor/content/video/components/columns.tsx b/app/[locale]/(protected)/contributor/content/video/components/columns.tsx index 0fbf71f6..e15da319 100644 --- a/app/[locale]/(protected)/contributor/content/video/components/columns.tsx +++ b/app/[locale]/(protected)/contributor/content/video/components/columns.tsx @@ -123,10 +123,13 @@ const useTableColumns = () => { "menunggu review": "bg-orange-100 text-orange-600", }; - const status = row.getValue("statusName") as string; - const statusName = status?.toLocaleLowerCase(); - const statusStyles = - statusColors[statusName] || "bg-red-200 text-red-600"; + const isPublish = row.original.isPublish; + const isPublishOnPolda = row.original.isPublishOnPolda; + + const status = + isPublish || isPublishOnPolda ? "diterima" : "menunggu review"; + + const statusStyles = statusColors[status] || "bg-red-200 text-red-600"; return ( { statusStyles )} > - {status} {/* Tetap tampilkan nilai asli */} + {status} ); },