diff --git a/app/[locale]/(public)/audio/detail/[slug]/page.tsx b/app/[locale]/(public)/audio/detail/[slug]/page.tsx index df29c9c6..1cf117e1 100644 --- a/app/[locale]/(public)/audio/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/audio/detail/[slug]/page.tsx @@ -592,7 +592,7 @@ const DetailAudio = () => {

- {t("by")} {detailDataAudio?.uploadedBy?.userLevel?.name} + {t("by")} {detailDataAudio?.uploadedBy?.userLevel?.name}

{/*

 | {t("updatedOn")} {detailDataAudio?.updatedAt} WIB  |  @@ -621,7 +621,7 @@ const DetailAudio = () => {

{/* Bagian Kanan */} -
+
{isSaved ? ( handleDeleteWishlist()} className="flex flex-col mb-3 items-center justify-center cursor-pointer"> @@ -724,7 +724,7 @@ const DetailAudio = () => {
{/* Comment */} -
+

{t("comment")}

diff --git a/app/[locale]/(public)/content-management/rewrite/detail/[id]/page.tsx b/app/[locale]/(public)/content-management/rewrite/detail/[id]/page.tsx index 27740dad..ed58c1cd 100644 --- a/app/[locale]/(public)/content-management/rewrite/detail/[id]/page.tsx +++ b/app/[locale]/(public)/content-management/rewrite/detail/[id]/page.tsx @@ -280,8 +280,10 @@ const page = () => {
-
- +
+ {}} initialData={articleBody || ""} />
diff --git a/app/[locale]/(public)/content-management/users/page.tsx b/app/[locale]/(public)/content-management/users/page.tsx index 6f047011..3342a832 100644 --- a/app/[locale]/(public)/content-management/users/page.tsx +++ b/app/[locale]/(public)/content-management/users/page.tsx @@ -132,10 +132,10 @@ const page = () => {
-
+
-

{row?.fullname}

-

{row?.username || "username"}

+

{row?.fullname}

+

{row?.username || "username"}

diff --git a/app/[locale]/(public)/document/detail/[slug]/page.tsx b/app/[locale]/(public)/document/detail/[slug]/page.tsx index c6c27d58..a9d3a4ce 100644 --- a/app/[locale]/(public)/document/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/document/detail/[slug]/page.tsx @@ -140,11 +140,19 @@ const DetailDocument = () => { } }; - const sizes = [ - { label: "DOC", value: "...KB" }, - { label: "PPT", value: "...KB" }, - { label: "PDF", value: "...KB" }, - ]; + const size = [{ label: "DOC" }, { label: "PPT" }, { label: "PDF" }]; + + function formatBytes(kb: any, decimals = 2) { + if (kb == 0 || kb == null) return "0 KB"; + + const k = 1024; + const dm = decimals < 0 ? 0 : decimals; + const sizes = ["KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; + + const i = Math.floor(Math.log(kb) / Math.log(k)); + + return `${parseFloat((kb / k ** i).toFixed(dm))} ${sizes[i]}`; + } async function sendActivityLog(activityTypeId: number) { const data = { @@ -422,6 +430,7 @@ const DetailDocument = () => { Main
+ {/* Footer Informasi */}
{/*

@@ -433,7 +442,7 @@ const DetailDocument = () => {

Kreator: {detailDataDocument?.creatorName}

*/}

- {t("by")} {detailDataDocument?.uploadedBy?.userLevel?.name} + {t("by")} {detailDataDocument?.uploadedBy?.userLevel?.name}

{/*

 |  {t("updatedOn")} {detailDataDocument?.updatedAt} WIB  |  @@ -443,7 +452,8 @@ const DetailDocument = () => { {formatDateToIndonesian(new Date(detailDataDocument?.updatedAt))} {"WIB"}

-  |   +  |   +  {detailDataDocument?.clickCount} 

@@ -457,13 +467,13 @@ const DetailDocument = () => { {/* Keterangan */}
-

{detailDataDocument?.title}

-
+

{detailDataDocument?.title}

+
{/* Bagian Kanan */} -
+
{isSaved ? ( handleDeleteWishlist()} className="flex flex-col mb-3 items-center justify-center cursor-pointer"> @@ -497,14 +507,14 @@ const DetailDocument = () => {

{t("docSize")}

- {sizes.map((size: any) => ( + {size.map((size: any) => (
setSelectedSize(size.label)} className="text-red-600 focus:ring-red-600" />
{size.label}
-
{size.value}
+
{formatBytes(size?.size)}
))} @@ -564,7 +574,7 @@ const DetailDocument = () => {
{/* Comment */} -
+

{t("comment")}