diff --git a/app/[locale]/(protected)/contributor/schedule/calendar-polri/component/calendar-polri-table.tsx b/app/[locale]/(protected)/contributor/schedule/calendar-polri/component/calendar-polri-table.tsx index dcf81544..eb3e6dcc 100644 --- a/app/[locale]/(protected)/contributor/schedule/calendar-polri/component/calendar-polri-table.tsx +++ b/app/[locale]/(protected)/contributor/schedule/calendar-polri/component/calendar-polri-table.tsx @@ -60,7 +60,6 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Label } from "@/components/ui/label"; -import { CalendarPolriAdd } from "@/components/form/schedule/form-calendar-polri"; const CalendarPolriTable = () => { const router = useRouter(); @@ -75,7 +74,7 @@ const CalendarPolriTable = () => { const [columnVisibility, setColumnVisibility] = React.useState({}); const [rowSelection, setRowSelection] = React.useState({}); - const [showData, setShowData] = React.useState("50"); + const [showData, setShowData] = React.useState("10"); const [pagination, setPagination] = React.useState({ pageIndex: 0, pageSize: Number(showData), @@ -161,7 +160,8 @@ const CalendarPolriTable = () => {
- {t("calendar-polri", { defaultValue: "Calendar Polri" })} {t("schedule", { defaultValue: "Schedule" })} + {t("calendar-polri", { defaultValue: "Calendar Polri" })}{" "} + {t("schedule", { defaultValue: "Schedule" })}
diff --git a/app/[locale]/(protected)/contributor/schedule/live-report/component/live-report-table.tsx b/app/[locale]/(protected)/contributor/schedule/live-report/component/live-report-table.tsx index 27c17917..1e0336bd 100644 --- a/app/[locale]/(protected)/contributor/schedule/live-report/component/live-report-table.tsx +++ b/app/[locale]/(protected)/contributor/schedule/live-report/component/live-report-table.tsx @@ -80,7 +80,7 @@ const LiveReportTable = () => { const [columnVisibility, setColumnVisibility] = React.useState({}); const [rowSelection, setRowSelection] = React.useState({}); - const [showData, setShowData] = React.useState("50"); + const [showData, setShowData] = React.useState("10"); const [pagination, setPagination] = React.useState({ pageIndex: 0, pageSize: Number(showData), diff --git a/components/form/content/audio-detail-form.tsx b/components/form/content/audio-detail-form.tsx index bfeab8f4..66d1d069 100644 --- a/components/form/content/audio-detail-form.tsx +++ b/components/form/content/audio-detail-form.tsx @@ -151,15 +151,13 @@ export default function FormAudioDetail() { const [files, setFiles] = useState([]); const [uploadedFiles, setUploadedFiles] = useState([]); const [detailThumb, setDetailThumb] = useState([]); - const waveSurferRef = useRef(null); const waveSurfersRef = useRef([]); const [isPlayingIndex, setIsPlayingIndex] = useState(null); - const [wavesurfer, setWavesurfer] = useState(); const [isPlaying, setIsPlaying] = useState(false); const [approval, setApproval] = useState(); - + const onDrop = (acceptedFiles: File[]) => { setUploadedFiles(acceptedFiles); const blobUrls = acceptedFiles.map((file) => URL.createObjectURL(file)); diff --git a/components/form/content/audio-form.tsx b/components/form/content/audio-form.tsx index 838a3077..24bf5174 100644 --- a/components/form/content/audio-form.tsx +++ b/components/form/content/audio-form.tsx @@ -179,9 +179,13 @@ export default function FormAudio() { const filesWithPreview = acceptedFiles.map((file) => Object.assign(file, { preview: URL.createObjectURL(file) }) ); - setFiles(filesWithPreview); - setValue("files", filesWithPreview, { shouldValidate: true }); + setFiles((prevFiles) => [...prevFiles, ...filesWithPreview]); + + const prevFiles = getValues("files") || []; + setValue("files", [...prevFiles, ...filesWithPreview], { + shouldValidate: true, + }); }, }); @@ -570,7 +574,6 @@ export default function FormAudio() { Cookies.set("idCreate", response?.data?.data, { expires: 1 }); id = response?.data?.data; - // Upload Thumbnail const formMedia = new FormData(); console.log("Thumbnail : ", files[0]); formMedia.append("file", files[0]); @@ -581,7 +584,6 @@ export default function FormAudio() { } } - // Upload File const progressInfoArr = []; for (const item of files) { progressInfoArr.push({ percentage: 0, fileName: item.name }); @@ -645,7 +647,7 @@ export default function FormAudio() { filename: file.name, filetype: file.type, duration, - isWatermark: "false", // hardcode + isWatermark: "false", }, onBeforeRequest: function (req) { var xhr = req.getUnderlyingObject(); @@ -787,7 +789,6 @@ export default function FormAudio() { }; useEffect(() => { - // Jika input title kosong, isi dengan hasil generate title if (!getValues("title") && title) { setValue("title", title); } @@ -801,7 +802,7 @@ export default function FormAudio() { lang: "id", contextType: "text", urlContext: null, - context: editorContent, // Ambil isi editor original + context: editorContent, createdBy: roleId, sentiment: "Humorous", clientId: "7QTW8cMojyayt6qnhqTOeJaBI70W4EaQ", diff --git a/components/form/content/spit-convert-form.tsx b/components/form/content/spit-convert-form.tsx index 51643adf..fdaee85d 100644 --- a/components/form/content/spit-convert-form.tsx +++ b/components/form/content/spit-convert-form.tsx @@ -757,7 +757,7 @@ export default function FormConvertSPIT() { render={({ field }) => ( )} /> diff --git a/components/form/content/video-detail-form.tsx b/components/form/content/video-detail-form.tsx index b1464b77..215eb31d 100644 --- a/components/form/content/video-detail-form.tsx +++ b/components/form/content/video-detail-form.tsx @@ -252,9 +252,9 @@ export default function FormVideoDetail() { setSelectedTarget(matchingCategory.name); } - setSelectedTarget(details.categoryId); // Untuk dropdown + setSelectedTarget(details?.categoryId); - const filesData = details.files || []; + const filesData = details?.files || []; const fileUrls = filesData.map((files: { url: string }) => files.url ? files.url : "default-image.jpg" ); diff --git a/components/main/audio-detail.tsx b/components/main/audio-detail.tsx index 4188e549..385be5af 100644 --- a/components/main/audio-detail.tsx +++ b/components/main/audio-detail.tsx @@ -274,13 +274,13 @@ const DetailAudio = () => { }; const sizes = [ - { label: "MP3", value: "... MB" }, - { label: "WAV", value: "... MB" }, + { label: "MP3", value: "100 MB" }, + { label: "WAV", value: "100 MB" }, ]; const handleShare = (type: any, url: any) => { if (Number(userRoleId) < 1 || userRoleId == undefined) { - router.push("/auth/login"); + router.push("/auth"); } else { sendActivityLog(2); sendActivityLog(4); @@ -641,6 +641,40 @@ const DetailAudio = () => { defaultValue={volume} />
+ {/* audio kedua bawah */} +
+
+ {detailDataAudio?.files?.map((file: any, index: number) => ( + + setMain({ + id: detailDataAudio.files[index]?.id, + type: detailDataAudio.fileType.name, + url: + Number(detailDataAudio.fileType?.id) == 4 + ? detailDataAudio.files[index]?.secondaryUrl + : Number(detailDataAudio.fileType?.id) == 2 + ? `${process.env.NEXT_PUBLIC_API}/media/view?id=${detailDataAudio.files[0]?.id}&operation=file&type=video` + : detailDataAudio.files[index]?.url, + thumbnailFileUrl: + detailDataAudio.files[index]?.thumbnailFileUrl, + names: detailDataAudio.files[index]?.fileName, + format: detailDataAudio.files[index]?.format, + widthPixel: detailDataAudio.files[index]?.widthPixel, + heightPixel: detailDataAudio.files[index]?.heightPixel, + size: detailDataAudio.files[index]?.size, + caption: detailDataAudio.files[index]?.caption, + }) + } + key={file?.id} + > +

+ {file.fileName} | {index + 1} +

+
+ ))} +
+
{/* Footer Informasi */}
@@ -655,7 +689,8 @@ const DetailAudio = () => {  | {t("updatedOn", { defaultValue: "Updated On" })} {detailDataAudio?.updatedAt} WIB  | 

*/}

-  | {t("updatedOn", { defaultValue: "Updated On" })}  +  | {t("updatedOn", { defaultValue: "Updated On" })} +   {formatDateToIndonesian( new Date(detailDataAudio?.updatedAt) )}{" "} @@ -669,7 +704,8 @@ const DetailAudio = () => {

- {t("creator", { defaultValue: "Creator" })} {detailDataAudio?.creatorName} + {t("creator", { defaultValue: "Creator" })}{" "} + {detailDataAudio?.creatorName}

@@ -695,7 +731,9 @@ const DetailAudio = () => { className="flex flex-col mb-3 items-center justify-center cursor-pointer" > -

{t("delete", { defaultValue: "Delete" })}

+

+ {t("delete", { defaultValue: "Delete" })} +

) : ( { className="flex flex-col mb-3 items-center justify-center cursor-pointer" > -

{t("save", { defaultValue: "Save" })}

+

+ {t("save", { defaultValue: "Save" })} +

)} @@ -745,7 +785,7 @@ const DetailAudio = () => { key={size.label} className="items-center flex flex-row gap-2 cursor-pointer" > - { className="text-red-600 focus:ring-red-600" onChange={() => setIsDownloadAll(!isDownloadAll)} /> - {t("downloadAll", { defaultValue: "Download All" })} + + {t("downloadAll", { defaultValue: "Download All" })} + @@ -795,7 +837,49 @@ const DetailAudio = () => { {/* Tombol Bagikan */}
-

{t("share", { defaultValue: "Share" })}

+
+ + + + + +
+

+ {t("shareTo", { defaultValue: "Share To" })} +

+
+

+ {t("destinationEmail", { + defaultValue: "Destination Email", + })} +

+ + setEmailShareInput(event.target.value) + } + onKeyPress={handleEmailList} + type="email" + placeholder={t("pressEnter", { + defaultValue: "Press Enter", + })} + /> +
+ +
+
+
+
{" "} @@ -861,10 +945,14 @@ const DetailAudio = () => {
-

{t("shareTo", { defaultValue: "Share To" })}

+

+ {t("shareTo", { defaultValue: "Share To" })} +

- {t("destinationEmail", { defaultValue: "Destination Email" })} + {t("destinationEmail", { + defaultValue: "Destination Email", + })}

{ } onKeyPress={handleEmailList} type="email" - placeholder={t("pressEnter", { defaultValue: "Press Enter" })} + placeholder={t("pressEnter", { + defaultValue: "Press Enter", + })} />