From 95860da6d67309bc4576ddcde34886d759e05687 Mon Sep 17 00:00:00 2001 From: Anang Yusman Date: Thu, 16 Jan 2025 20:52:59 +0800 Subject: [PATCH] feat:fix penugasan,filter content,update content --- .../content/audio/components/columns.tsx | 10 +- .../content/audio/components/table-audio.tsx | 228 ++++++++++++++-- .../content/image/components/columns.tsx | 10 +- .../content/image/components/table-image.tsx | 228 ++++++++++++---- .../content/spit/table-spit/columns.tsx | 2 +- .../content/spit/table-spit/table-spit.tsx | 4 +- .../content/teks/components/columns.tsx | 10 +- .../content/teks/components/table-teks.tsx | 232 ++++++++++++++-- .../content/video/components/columns.tsx | 10 +- .../content/video/components/table-video.tsx | 237 ++++++++++++++-- components/form/task/task-detail-form.tsx | 256 ++++++++++-------- components/form/task/task-edit-form.tsx | 14 +- components/form/task/task-form.tsx | 14 +- service/content/content.ts | 20 +- 14 files changed, 985 insertions(+), 290 deletions(-) diff --git a/app/[locale]/(protected)/contributor/content/audio/components/columns.tsx b/app/[locale]/(protected)/contributor/content/audio/components/columns.tsx index a31c3683..f6410a19 100644 --- a/app/[locale]/(protected)/contributor/content/audio/components/columns.tsx +++ b/app/[locale]/(protected)/contributor/content/audio/components/columns.tsx @@ -68,17 +68,19 @@ const columns: ColumnDef[] = [ }, }, { - accessorKey: "creatorGroup", + accessorKey: "creatorName", header: "Creator Group", cell: ({ row }) => ( - {row.getValue("creatorGroup")} + {row.getValue("creatorName")} ), }, { - accessorKey: "creatorName", + accessorKey: "creatorGroupLevelName", header: "Sumber", cell: ({ row }) => ( - {row.getValue("creatorName")} + + {row.getValue("creatorGroupLevelName")} + ), }, { diff --git a/app/[locale]/(protected)/contributor/content/audio/components/table-audio.tsx b/app/[locale]/(protected)/contributor/content/audio/components/table-audio.tsx index 3f42e5e1..0fcfcb37 100644 --- a/app/[locale]/(protected)/contributor/content/audio/components/table-audio.tsx +++ b/app/[locale]/(protected)/contributor/content/audio/components/table-audio.tsx @@ -26,6 +26,7 @@ import { } from "@/components/ui/table"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { + ChevronDown, ChevronLeft, ChevronRight, Eye, @@ -39,6 +40,7 @@ import { import { cn, getCookiesDecrypt } from "@/lib/utils"; import { DropdownMenu, + DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, @@ -55,7 +57,10 @@ import { listDataAudio, listDataImage, listDataVideo, + listEnableCategory, } from "@/service/content/content"; +import { Label } from "@/components/ui/label"; +import { format } from "date-fns"; const TableAudio = () => { const router = useRouter(); @@ -81,13 +86,17 @@ const TableAudio = () => { const userId = getCookiesDecrypt("uie"); const userLevelId = getCookiesDecrypt("ulie"); - const [categories, setCategories] = React.useState(); - const [categoryFilter, setCategoryFilter] = React.useState([]); + const [categories, setCategories] = React.useState([]); + const [selectedCategories, setSelectedCategories] = React.useState( + [] + ); + const [categoryFilter, setCategoryFilter] = React.useState(""); const [statusFilter, setStatusFilter] = React.useState([]); - const [startDateString, setStartDateString] = React.useState(""); - const [endDateString, setEndDateString] = React.useState(""); + const [startDate, setStartDate] = React.useState(""); + const [endDate, setEndDate] = React.useState(""); const [filterByCreator, setFilterByCreator] = React.useState(""); const [filterBySource, setFilterBySource] = React.useState(""); + const [filterByCreatorGroup, setFilterByCreatorGroup] = React.useState(""); const roleId = getCookiesDecrypt("urie"); @@ -121,35 +130,69 @@ const TableAudio = () => { React.useEffect(() => { fetchData(); - }, [page, limit, search]); + getCategories(); + }, [categoryFilter, page, limit, search, startDate, endDate]); + + async function getCategories() { + const category = await listEnableCategory("4"); + const resCategory = category?.data?.data?.content; + setCategories(resCategory || []); + } + + // Fungsi menangani perubahan checkbox + const handleCheckboxChange = (categoryId: number) => { + setSelectedCategories( + (prev: any) => + prev.includes(categoryId) + ? prev.filter((id: any) => id !== categoryId) // Hapus jika sudah dipilih + : [...prev, categoryId] // Tambahkan jika belum dipilih + ); + + // Perbarui filter kategori + setCategoryFilter((prev) => { + const updatedCategories = prev.split(",").filter(Boolean).map(Number); + + const newCategories = updatedCategories.includes(categoryId) + ? updatedCategories.filter((id) => id !== categoryId) + : [...updatedCategories, categoryId]; + + return newCategories.join(","); + }); + }; async function fetchData() { + const formattedStartDate = startDate + ? format(new Date(startDate), "yyyy-MM-dd") + : ""; + const formattedEndDate = endDate + ? format(new Date(endDate), "yyyy-MM-dd") + : ""; try { - const isForSelf = Number(roleId) == 4; + const isForSelf = Number(roleId) === 4; const res = await listDataAudio( limit, page - 1, isForSelf, !isForSelf, - categoryFilter?.sort().join(","), + categoryFilter, statusFilter?.sort().join(",").includes("1") ? "1,2" : statusFilter?.sort().join(","), statusFilter?.sort().join(",").includes("1") ? userLevelId : "", filterByCreator, filterBySource, - startDateString, - endDateString, - search + formattedStartDate, // Pastikan format sesuai + formattedEndDate, // Pastikan format sesuai + search, + filterByCreatorGroup ); + const data = res?.data?.data; const contentData = data?.content; contentData.forEach((item: any, index: number) => { item.no = (page - 1) * limit + index + 1; }); - console.log("contentData : ", contentData); - setDataTable(contentData); setTotalData(data?.totalElements); setTotalPage(data?.totalPages); @@ -157,11 +200,28 @@ const TableAudio = () => { console.error("Error fetching tasks:", error); } } + const handleSearch = (e: React.ChangeEvent) => { setSearch(e.target.value); // Perbarui state search table.getColumn("judul")?.setFilterValue(e.target.value); // Set filter tabel }; + const handleSearchFilterBySource = ( + e: React.ChangeEvent + ) => { + const value = e.target.value; + setFilterBySource(value); // Perbarui state filter + fetchData(); // Panggil ulang data dengan filter baru + }; + + const handleSearchFilterByCreator = ( + e: React.ChangeEvent + ) => { + const value = e.target.value; + setFilterByCreator(value); // Perbarui state filter + fetchData(); // Panggil ulang data dengan filter baru + }; + return (
@@ -179,17 +239,139 @@ const TableAudio = () => { />
-
- ) => - table.getColumn("status")?.setFilterValue(event.target.value) - } - className="max-w-sm " - /> +
+
+ + + + + +
+

Filter

+ {/*

+ Simpan +

*/} +
+ + {categories.length > 0 ? ( + categories.map((category) => ( +
+ handleCheckboxChange(category.id)} + /> + +
+ )) + ) : ( +

+ No categories found. +

+ )} +
+ + setStartDate(e.target.value)} + className="max-w-sm" + /> +
+
+ + setEndDate(e.target.value)} + className="max-w-sm" + /> +
+
+ + +
+
+ + +
+ +
+ + ) => + table + .getColumn("statusName") + ?.setFilterValue(event.target.value) + } + className="max-w-sm " + /> +
+
+
+
+
+ + + + + + {table + .getAllColumns() + .filter((column) => column.getCanHide()) + .map((column) => { + return ( + + column.toggleVisibility(!!value) + } + > + {column.id} + + ); + })} + + +
diff --git a/app/[locale]/(protected)/contributor/content/image/components/columns.tsx b/app/[locale]/(protected)/contributor/content/image/components/columns.tsx index dcc54f88..4e1a7d8b 100644 --- a/app/[locale]/(protected)/contributor/content/image/components/columns.tsx +++ b/app/[locale]/(protected)/contributor/content/image/components/columns.tsx @@ -72,17 +72,19 @@ const columns: ColumnDef[] = [ }, }, { - accessorKey: "creatorGroup", + accessorKey: "creatorName", header: "Creator Group", cell: ({ row }) => ( - {row.getValue("creatorGroup")} + {row.getValue("creatorName")} ), }, { - accessorKey: "creatorName", + accessorKey: "creatorGroupLevelName", header: "Sumber", cell: ({ row }) => ( - {row.getValue("creatorName")} + + {row.getValue("creatorGroupLevelName")} + ), }, { diff --git a/app/[locale]/(protected)/contributor/content/image/components/table-image.tsx b/app/[locale]/(protected)/contributor/content/image/components/table-image.tsx index 2f51e56d..9c14dfc8 100644 --- a/app/[locale]/(protected)/contributor/content/image/components/table-image.tsx +++ b/app/[locale]/(protected)/contributor/content/image/components/table-image.tsx @@ -53,13 +53,19 @@ import { Badge } from "@/components/ui/badge"; import { useRouter, useSearchParams } from "next/navigation"; import TablePagination from "@/components/table/table-pagination"; import columns from "./columns"; -import { deleteMedia, listDataImage } from "@/service/content/content"; +import { + deleteMedia, + listDataImage, + listEnableCategory, +} from "@/service/content/content"; import { loading } from "@/config/swal"; import { toast } from "sonner"; import Swal from "sweetalert2"; import withReactContent from "sweetalert2-react-content"; import { error } from "@/lib/swal"; +import { Label } from "@/components/ui/label"; +import { format } from "date-fns"; const TableImage = () => { const router = useRouter(); @@ -85,13 +91,17 @@ const TableImage = () => { const userId = getCookiesDecrypt("uie"); const userLevelId = getCookiesDecrypt("ulie"); - const [categories, setCategories] = React.useState(); - const [categoryFilter, setCategoryFilter] = React.useState([]); + const [categories, setCategories] = React.useState([]); + const [selectedCategories, setSelectedCategories] = React.useState( + [] + ); + const [categoryFilter, setCategoryFilter] = React.useState(""); const [statusFilter, setStatusFilter] = React.useState([]); - const [startDateString, setStartDateString] = React.useState(""); - const [endDateString, setEndDateString] = React.useState(""); + const [startDate, setStartDate] = React.useState(""); + const [endDate, setEndDate] = React.useState(""); const [filterByCreator, setFilterByCreator] = React.useState(""); const [filterBySource, setFilterBySource] = React.useState(""); + const [filterByCreatorGroup, setFilterByCreatorGroup] = React.useState(""); const roleId = getCookiesDecrypt("urie"); @@ -124,36 +134,71 @@ const TableImage = () => { }, [searchParams]); React.useEffect(() => { + // Panggil fetchData saat filter kategori berubah fetchData(); - }, [page, limit, search]); + getCategories(); + }, [categoryFilter, page, limit, search, startDate, endDate]); + + async function getCategories() { + const category = await listEnableCategory("1"); + const resCategory = category?.data?.data?.content; + setCategories(resCategory || []); + } + + // Fungsi menangani perubahan checkbox + const handleCheckboxChange = (categoryId: number) => { + setSelectedCategories( + (prev: any) => + prev.includes(categoryId) + ? prev.filter((id: any) => id !== categoryId) // Hapus jika sudah dipilih + : [...prev, categoryId] // Tambahkan jika belum dipilih + ); + + // Perbarui filter kategori + setCategoryFilter((prev) => { + const updatedCategories = prev.split(",").filter(Boolean).map(Number); + + const newCategories = updatedCategories.includes(categoryId) + ? updatedCategories.filter((id) => id !== categoryId) + : [...updatedCategories, categoryId]; + + return newCategories.join(","); + }); + }; async function fetchData() { + const formattedStartDate = startDate + ? format(new Date(startDate), "yyyy-MM-dd") + : ""; + const formattedEndDate = endDate + ? format(new Date(endDate), "yyyy-MM-dd") + : ""; try { - const isForSelf = Number(roleId) == 4; + const isForSelf = Number(roleId) === 4; const res = await listDataImage( limit, page - 1, isForSelf, !isForSelf, - categoryFilter?.sort().join(","), + categoryFilter, statusFilter?.sort().join(",").includes("1") ? "1,2" : statusFilter?.sort().join(","), statusFilter?.sort().join(",").includes("1") ? userLevelId : "", filterByCreator, filterBySource, - startDateString, - endDateString, - search + formattedStartDate, // Pastikan format sesuai + formattedEndDate, // Pastikan format sesuai + search, + filterByCreatorGroup ); + const data = res?.data?.data; const contentData = data?.content; contentData.forEach((item: any, index: number) => { item.no = (page - 1) * limit + index + 1; }); - console.log("contentData : ", contentData); - setDataTable(contentData); setTotalData(data?.totalElements); setTotalPage(data?.totalPages); @@ -167,36 +212,21 @@ const TableImage = () => { table.getColumn("judul")?.setFilterValue(e.target.value); // Set filter tabel }; - // async function doDelete(id: any) { - // loading(); - // const data = { - // id, - // }; + const handleSearchFilterBySource = ( + e: React.ChangeEvent + ) => { + const value = e.target.value; + setFilterBySource(value); // Perbarui state filter + fetchData(); // Panggil ulang data dengan filter baru + }; - // const response = await deleteMedia(data); - - // if (response?.error) { - // error(response.message); - // return false; - // } - - // fetchData(); - // toast.success("Konten berhasil dihapus"); - // } - - // const handleDeleteMedia = (id: any) => { - // MySwal.fire({ - // title: "Apakah anda ingin menghapus konten?", - // showCancelButton: true, - // confirmButtonColor: "#dc3545", - // confirmButtonText: "Iya", - // cancelButtonText: "Tidak", - // }).then((result: any) => { - // if (result.isConfirmed) { - // doDelete(id); - // } - // }); - // }; + const handleSearchFilterByCreator = ( + e: React.ChangeEvent + ) => { + const value = e.target.value; + setFilterByCreator(value); // Perbarui state filter + fetchData(); // Panggil ulang data dengan filter baru + }; return (
@@ -216,16 +246,110 @@ const TableImage = () => {
- ) => - table.getColumn("status")?.setFilterValue(event.target.value) - } - className="max-w-sm " - /> +
+ + + + + +
+

Filter

+ {/*

+ Simpan +

*/} +
+ + {categories.length > 0 ? ( + categories.map((category) => ( +
+ handleCheckboxChange(category.id)} + /> + +
+ )) + ) : ( +

+ No categories found. +

+ )} +
+ + setStartDate(e.target.value)} + className="max-w-sm" + /> +
+
+ + setEndDate(e.target.value)} + className="max-w-sm" + /> +
+
+ + +
+
+ + +
+ +
+ + ) => + table + .getColumn("statusName") + ?.setFilterValue(event.target.value) + } + className="max-w-sm " + /> +
+
+
+
diff --git a/app/[locale]/(protected)/contributor/content/spit/table-spit/columns.tsx b/app/[locale]/(protected)/contributor/content/spit/table-spit/columns.tsx index aa706fb3..1eaa46ef 100644 --- a/app/[locale]/(protected)/contributor/content/spit/table-spit/columns.tsx +++ b/app/[locale]/(protected)/contributor/content/spit/table-spit/columns.tsx @@ -77,7 +77,7 @@ const columns: ColumnDef[] = [
+ + +
+

Filter

+ {/*

+ Simpan +

*/} +
+ + {categories.length > 0 ? ( + categories.map((category) => ( +
+ handleCheckboxChange(category.id)} + /> + +
+ )) + ) : ( +

+ No categories found. +

+ )} +
+ + setStartDate(e.target.value)} + className="max-w-sm" + /> +
+
+ + setEndDate(e.target.value)} + className="max-w-sm" + /> +
+
+ + +
+
+ + +
+ +
+ + ) => + table + .getColumn("statusName") + ?.setFilterValue(event.target.value) + } + className="max-w-sm " + /> +
+
+ +
+
+ + + + + + {table + .getAllColumns() + .filter((column) => column.getCanHide()) + .map((column) => { + return ( + + column.toggleVisibility(!!value) + } + > + {column.id} + + ); + })} + + +
diff --git a/app/[locale]/(protected)/contributor/content/video/components/columns.tsx b/app/[locale]/(protected)/contributor/content/video/components/columns.tsx index af0704cc..399b44d7 100644 --- a/app/[locale]/(protected)/contributor/content/video/components/columns.tsx +++ b/app/[locale]/(protected)/contributor/content/video/components/columns.tsx @@ -68,17 +68,19 @@ const columns: ColumnDef[] = [ }, }, { - accessorKey: "creatorGroup", + accessorKey: "creatorName", header: "Creator Group", cell: ({ row }) => ( - {row.getValue("creatorGroup")} + {row.getValue("creatorName")} ), }, { - accessorKey: "creatorName", + accessorKey: "creatorGroupLevelName", header: "Sumber", cell: ({ row }) => ( - {row.getValue("creatorName")} + + {row.getValue("creatorGroupLevelName")} + ), }, { diff --git a/app/[locale]/(protected)/contributor/content/video/components/table-video.tsx b/app/[locale]/(protected)/contributor/content/video/components/table-video.tsx index c5b2bd8e..90a47401 100644 --- a/app/[locale]/(protected)/contributor/content/video/components/table-video.tsx +++ b/app/[locale]/(protected)/contributor/content/video/components/table-video.tsx @@ -26,6 +26,7 @@ import { } from "@/components/ui/table"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { + ChevronDown, ChevronLeft, ChevronRight, Eye, @@ -39,6 +40,7 @@ import { import { cn, getCookiesDecrypt } from "@/lib/utils"; import { DropdownMenu, + DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, @@ -51,9 +53,15 @@ import { Badge } from "@/components/ui/badge"; import { useRouter, useSearchParams } from "next/navigation"; import TablePagination from "@/components/table/table-pagination"; import columns from "./columns"; -import { listDataImage, listDataVideo } from "@/service/content/content"; +import { + listDataImage, + listDataVideo, + listEnableCategory, +} from "@/service/content/content"; +import { Label } from "@/components/ui/label"; +import { format } from "date-fns"; -const TableImage = () => { +const TableVideo = () => { const router = useRouter(); const searchParams = useSearchParams(); @@ -77,13 +85,17 @@ const TableImage = () => { const userId = getCookiesDecrypt("uie"); const userLevelId = getCookiesDecrypt("ulie"); - const [categories, setCategories] = React.useState(); - const [categoryFilter, setCategoryFilter] = React.useState([]); + const [categories, setCategories] = React.useState([]); + const [selectedCategories, setSelectedCategories] = React.useState( + [] + ); + const [categoryFilter, setCategoryFilter] = React.useState(""); const [statusFilter, setStatusFilter] = React.useState([]); - const [startDateString, setStartDateString] = React.useState(""); - const [endDateString, setEndDateString] = React.useState(""); + const [startDate, setStartDate] = React.useState(""); + const [endDate, setEndDate] = React.useState(""); const [filterByCreator, setFilterByCreator] = React.useState(""); const [filterBySource, setFilterBySource] = React.useState(""); + const [filterByCreatorGroup, setFilterByCreatorGroup] = React.useState(""); const roleId = getCookiesDecrypt("urie"); @@ -117,35 +129,69 @@ const TableImage = () => { React.useEffect(() => { fetchData(); - }, [page, limit, search]); + getCategories(); + }, [categoryFilter, page, limit, search, startDate, endDate]); + + async function getCategories() { + const category = await listEnableCategory("2"); + const resCategory = category?.data?.data?.content; + setCategories(resCategory || []); + } + + // Fungsi menangani perubahan checkbox + const handleCheckboxChange = (categoryId: number) => { + setSelectedCategories( + (prev: any) => + prev.includes(categoryId) + ? prev.filter((id: any) => id !== categoryId) // Hapus jika sudah dipilih + : [...prev, categoryId] // Tambahkan jika belum dipilih + ); + + // Perbarui filter kategori + setCategoryFilter((prev) => { + const updatedCategories = prev.split(",").filter(Boolean).map(Number); + + const newCategories = updatedCategories.includes(categoryId) + ? updatedCategories.filter((id) => id !== categoryId) + : [...updatedCategories, categoryId]; + + return newCategories.join(","); + }); + }; async function fetchData() { + const formattedStartDate = startDate + ? format(new Date(startDate), "yyyy-MM-dd") + : ""; + const formattedEndDate = endDate + ? format(new Date(endDate), "yyyy-MM-dd") + : ""; try { - const isForSelf = Number(roleId) == 4; + const isForSelf = Number(roleId) === 4; const res = await listDataVideo( limit, page - 1, isForSelf, !isForSelf, - categoryFilter?.sort().join(","), + categoryFilter, statusFilter?.sort().join(",").includes("1") ? "1,2" : statusFilter?.sort().join(","), statusFilter?.sort().join(",").includes("1") ? userLevelId : "", filterByCreator, filterBySource, - startDateString, - endDateString, - search + formattedStartDate, // Pastikan format sesuai + formattedEndDate, // Pastikan format sesuai + search, + filterByCreatorGroup ); + const data = res?.data?.data; const contentData = data?.content; contentData.forEach((item: any, index: number) => { item.no = (page - 1) * limit + index + 1; }); - console.log("contentData : ", contentData); - setDataTable(contentData); setTotalData(data?.totalElements); setTotalPage(data?.totalPages); @@ -159,6 +205,22 @@ const TableImage = () => { table.getColumn("judul")?.setFilterValue(e.target.value); // Set filter tabel }; + const handleSearchFilterBySource = ( + e: React.ChangeEvent + ) => { + const value = e.target.value; + setFilterBySource(value); // Perbarui state filter + fetchData(); // Panggil ulang data dengan filter baru + }; + + const handleSearchFilterByCreator = ( + e: React.ChangeEvent + ) => { + const value = e.target.value; + setFilterByCreator(value); // Perbarui state filter + fetchData(); // Panggil ulang data dengan filter baru + }; + return (
@@ -176,17 +238,140 @@ const TableImage = () => { />
-
- ) => - table.getColumn("status")?.setFilterValue(event.target.value) - } - className="max-w-sm " - /> + +
+
+ + + + + +
+

Filter

+ {/*

+ Simpan +

*/} +
+ + {categories.length > 0 ? ( + categories.map((category) => ( +
+ handleCheckboxChange(category.id)} + /> + +
+ )) + ) : ( +

+ No categories found. +

+ )} +
+ + setStartDate(e.target.value)} + className="max-w-sm" + /> +
+
+ + setEndDate(e.target.value)} + className="max-w-sm" + /> +
+
+ + +
+
+ + +
+ +
+ + ) => + table + .getColumn("statusName") + ?.setFilterValue(event.target.value) + } + className="max-w-sm " + /> +
+
+
+
+
+ + + + + + {table + .getAllColumns() + .filter((column) => column.getCanHide()) + .map((column) => { + return ( + + column.toggleVisibility(!!value) + } + > + {column.id} + + ); + })} + + +
@@ -239,4 +424,4 @@ const TableImage = () => { ); }; -export default TableImage; +export default TableVideo; diff --git a/components/form/task/task-detail-form.tsx b/components/form/task/task-detail-form.tsx index 36391e38..a0fec401 100644 --- a/components/form/task/task-detail-form.tsx +++ b/components/form/task/task-detail-form.tsx @@ -240,15 +240,27 @@ export default function FormTaskDetail() { const [imageUploadedFiles, setImageUploadedFiles] = useState( [] ); + const [selectedImage, setSelectedImage] = useState( + imageUploadedFiles?.[0]?.url || null + ); const [videoUploadedFiles, setVideoUploadedFiles] = useState( [] ); + const [selectedVideo, setSelectedVideo] = useState( + videoUploadedFiles?.[0]?.url || null + ); const [textUploadedFiles, setTextUploadedFiles] = useState( [] ); + const [selectedText, setSelectedText] = useState( + textUploadedFiles?.[0]?.url || null + ); const [audioUploadedFiles, setAudioUploadedFiles] = useState( [] ); + const [selectedAudio, setSelectedAudio] = useState( + audioUploadedFiles?.[0]?.url || null + ); const [platformTypeVisible, setPlatformTypeVisible] = useState(false); const [unitSelection, setUnitSelection] = useState({ @@ -358,10 +370,10 @@ export default function FormTaskDetail() { if (detail?.fileTypeOutput) { const outputSet = new Set(detail.fileTypeOutput.split(",").map(Number)); setTaskOutput({ - all: outputSet.has(0), + all: outputSet.has(1), video: outputSet.has(2), audio: outputSet.has(4), - image: outputSet.has(1), + image: outputSet.has(3), text: outputSet.has(5), }); } @@ -1028,24 +1040,32 @@ export default function FormTaskDetail() {
{videoUploadedFiles?.length > 0 && } - {videoUploadedFiles?.map((file: any, index: number) => ( -
-