From 1ae6bd334eb9e86122ecde72f2a8395042b3df6d Mon Sep 17 00:00:00 2001 From: Sabda Yagra Date: Mon, 5 May 2025 21:12:07 +0700 Subject: [PATCH] QUDO-30: [BUG] Search di Landing Navbar tolong diperbaiki --- .../area-coverage-and-work-units.tsx | 8 +- components/landing-page/content-category.tsx | 4 +- components/landing-page/navbar.tsx | 791 ++++-------------- components/landing-page/new-content.tsx | 269 +----- 4 files changed, 191 insertions(+), 881 deletions(-) diff --git a/components/landing-page/area-coverage-and-work-units.tsx b/components/landing-page/area-coverage-and-work-units.tsx index 7d1b26ae..dc626db6 100644 --- a/components/landing-page/area-coverage-and-work-units.tsx +++ b/components/landing-page/area-coverage-and-work-units.tsx @@ -20,7 +20,7 @@ const AreaCoverageWorkUnits = () => { indo

Polda Jajaran

- +

Polda Jajaran

@@ -29,7 +29,11 @@ const AreaCoverageWorkUnits = () => {
- + +
+ +
+
diff --git a/components/landing-page/content-category.tsx b/components/landing-page/content-category.tsx index 842b550f..ed22d084 100644 --- a/components/landing-page/content-category.tsx +++ b/components/landing-page/content-category.tsx @@ -77,7 +77,7 @@ const ContentCategory = (props: { group?: string }) => { {categories?.map((category: any) => ( - +
router.push(prefixPath + `all/filter?category=${category?.id}`)} className="cursor-pointer relative group rounded-md overflow-hidden shadow-md hover:shadow-lg block"> {/* Gambar */} {

{category?.name}

- +
))}
diff --git a/components/landing-page/navbar.tsx b/components/landing-page/navbar.tsx index b10a176c..91a987eb 100644 --- a/components/landing-page/navbar.tsx +++ b/components/landing-page/navbar.tsx @@ -6,23 +6,8 @@ import { FiFile, FiImage, FiMusic, FiYoutube } from "react-icons/fi"; import { useParams, usePathname } from "next/navigation"; import { generateLocalizedPath } from "@/utils/globals"; import { Link } from "@/i18n/routing"; -import { - NavigationMenu, - NavigationMenuContent, - NavigationMenuItem, - NavigationMenuLink, - NavigationMenuList, - NavigationMenuTrigger, - navigationMenuTriggerStyle, -} from "@/components/ui/navigation-menu"; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuGroup, - DropdownMenuItem, - DropdownMenuSeparator, - DropdownMenuTrigger, -} from "../ui/dropdown-menu"; +import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerStyle } from "@/components/ui/navigation-menu"; +import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../ui/dropdown-menu"; import Image from "next/image"; import { Icon } from "../ui/icon"; import { getCookiesDecrypt } from "@/lib/utils"; @@ -32,23 +17,10 @@ import { useTranslations } from "next-intl"; import { useRouter } from "@/i18n/routing"; import { Button } from "@/components/ui/button"; import LocalSwitcher from "../partials/header/locale-switcher"; -import { - Dialog, - DialogClose, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "@/components/ui/dialog"; +import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"; import { getUserNotifications, listRole } from "@/service/landing/landing"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/components/ui/popover"; +import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; type Detail = { id: number; @@ -80,6 +52,7 @@ const Navbar = () => { const t = useTranslations("LandingPage"); const [search, setSearch] = useState(""); const [onSearch, setOnSearch] = useState(""); + const [debouncedSearch, setDebouncedSearch] = useState(""); const pathname = usePathname(); const [role, setRole] = useState(); const [menuActive, setMenuActive] = useState(); @@ -89,11 +62,7 @@ const Navbar = () => { const [notificationsUpdate, setNotificationsUpdate] = useState([]); const [selectedTab, setSelectedTab] = useState("image"); - let prefixPath = poldaName - ? `/polda/${poldaName}` - : satkerName - ? `/satker/${satkerName}` - : "/"; + let prefixPath = poldaName ? `/polda/${poldaName}` : satkerName ? `/satker/${satkerName}` : "/"; let menu = ""; @@ -173,22 +142,24 @@ const Navbar = () => { // } // }; + useEffect(() => { + const handler = setTimeout(() => { + if (onSearch.trim()) { + setDebouncedSearch(onSearch); + router.push(`/all/filter?title=${encodeURIComponent(onSearch)}`); + } + }, 3000); + + return () => clearTimeout(handler); + }, [onSearch]); + return (
{/* Logo */} - - Media Hub Logo + + Media Hub Logo {/* Nav Menu */} @@ -198,14 +169,7 @@ const Navbar = () => { - + { - router.push(prefixPath + "/image/filter")} - className="flex place-items-start gap-1 px-3 py-1 w-36" - > + router.push(prefixPath + "/image/filter")} className="flex place-items-start gap-1 px-3 py-1 w-36">

{t("image")}

- router.push(prefixPath + "/video/filter")} - className="flex items-start gap-1 py-1 px-3 " - > + router.push(prefixPath + "/video/filter")} className="flex items-start gap-1 py-1 px-3 "> {pathname?.split("/")[1] == "in" ? ( <>

@@ -244,21 +202,13 @@ const Navbar = () => { )} - - router.push(prefixPath + "/document/filter") - } - className="flex place-items-start gap-1 py-1 px-3" - > + router.push(prefixPath + "/document/filter")} className="flex place-items-start gap-1 py-1 px-3">

{t("text")}

- router.push(prefixPath + "/audio/filter")} - className="flex place-items-start gap-1 py-1 px-3 " - > + router.push(prefixPath + "/audio/filter")} className="flex place-items-start gap-1 py-1 px-3 ">

{t("audio")}{" "} @@ -268,18 +218,9 @@ const Navbar = () => { - + - + { - + - + {

{/* Mobile Menu Toggle */} - @@ -397,13 +310,7 @@ const Navbar = () => { */} @@ -416,21 +323,17 @@ const Navbar = () => {
- setOnSearch(e.target.value)} onKeyPress={() => router.push(`/all/filter?title=${onSearch}`)} type="text" placeholder={t("search")} className="pl-8 pr-4 py-1 w-28 text-[13px] border rounded-full focus:outline-none dark:text-white" - /> + /> */} + setOnSearch(e.target.value)} type="text" placeholder="Search..." className="pl-8 pr-4 py-1 w-28 text-[13px] border rounded-full focus:outline-none dark:text-white" /> - + { )}
*/} - {roleId === "5" || - roleId === "6" || - roleId === "7" || - roleId === "8" ? ( + {roleId === "5" || roleId === "6" || roleId === "7" || roleId === "8" ? ( <> {/* Inbox */} test()}> {" "} - + - - + + { {
{notifications?.map((list: any) => ( - +
- avatar -
-
- {list?.message} + avatar
+
{list?.message}
- {`${new Date(list?.createdAt).getDate()}/${ - new Date(list?.createdAt).getMonth() + 1 - }/${new Date( - list?.createdAt - ).getFullYear()} ${new Date( - list?.createdAt - ).getHours()}:${new Date( + {`${new Date(list?.createdAt).getDate()}/${new Date(list?.createdAt).getMonth() + 1}/${new Date(list?.createdAt).getFullYear()} ${new Date(list?.createdAt).getHours()}:${new Date( list?.createdAt ).getMinutes()}`}{" "} @@ -585,10 +447,7 @@ const Navbar = () => { ))} -

+

{t("seeAll")}

@@ -597,33 +456,15 @@ const Navbar = () => {
{notificationsUpdate?.map((list: any) => ( - +
- ... + ...
-
- {list?.message} -
+
{list?.message}
- {`${new Date(list?.createdAt).getDate()}/${ - new Date(list?.createdAt).getMonth() + 1 - }/${new Date( - list?.createdAt - ).getFullYear()} ${new Date( - list?.createdAt - ).getHours()}:${new Date( + {`${new Date(list?.createdAt).getDate()}/${new Date(list?.createdAt).getMonth() + 1}/${new Date(list?.createdAt).getFullYear()} ${new Date(list?.createdAt).getHours()}:${new Date( list?.createdAt ).getMinutes()}`}{" "} @@ -632,10 +473,7 @@ const Navbar = () => { ))} -

+

{t("seeAll")}

@@ -648,20 +486,10 @@ const Navbar = () => { {detail !== undefined ? (
- {"Image"} + {"Image"}
-
- {detail?.fullname} -
-

- ({detail?.fullname}) -

+
{detail?.fullname}
+

({detail?.fullname})

@@ -685,11 +513,7 @@ const Navbar = () => { href: "/content-management/galery", }, ].map((item, index) => ( - + {item.name} @@ -701,11 +525,7 @@ const Navbar = () => {
- @@ -715,42 +535,22 @@ const Navbar = () => { - ) : roleId === "2" || - roleId === "3" || - roleId === "4" || - roleId === "9" || - roleId === "10" || - roleId === "11" || - roleId === "12" || - roleId === "13" ? ( + ) : roleId === "2" || roleId === "3" || roleId === "4" || roleId === "9" || roleId === "10" || roleId === "11" || roleId === "12" || roleId === "13" ? ( <> {/* Inbox */} test()}> {" "} - + - - + + { { -
+
{notifications?.map((list: any) => (
- ... + ...
-
- {list?.message} -
+
{list?.message}
- {`${new Date(list?.createdAt).getDate()}/${ - new Date(list?.createdAt).getMonth() + 1 - }/${new Date( - list?.createdAt - ).getFullYear()} ${new Date( - list?.createdAt - ).getHours()}:${new Date( + {`${new Date(list?.createdAt).getDate()}/${new Date(list?.createdAt).getMonth() + 1}/${new Date(list?.createdAt).getFullYear()} ${new Date(list?.createdAt).getHours()}:${new Date( list?.createdAt ).getMinutes()}`}{" "} @@ -819,39 +600,17 @@ const Navbar = () => {

-
+
{notificationsUpdate?.map((list: any) => ( - +
- ... + ...
-
- {list?.message} -
+
{list?.message}
- {`${new Date(list?.createdAt).getDate()}/${ - new Date(list?.createdAt).getMonth() + 1 - }/${new Date( - list?.createdAt - ).getFullYear()} ${new Date( - list?.createdAt - ).getHours()}:${new Date( + {`${new Date(list?.createdAt).getDate()}/${new Date(list?.createdAt).getMonth() + 1}/${new Date(list?.createdAt).getFullYear()} ${new Date(list?.createdAt).getHours()}:${new Date( list?.createdAt ).getMinutes()}`}{" "} @@ -873,20 +632,10 @@ const Navbar = () => { {detail !== undefined ? (
- {"Image"} + {"Image"}
-
- {detail?.fullname} -
-

- ({detail?.fullname}) -

+
{detail?.fullname}
+

({detail?.fullname})

@@ -910,11 +659,7 @@ const Navbar = () => { href: "/dashboard", }, ].map((item, index) => ( - + {item.name} @@ -926,11 +671,7 @@ const Navbar = () => {
- @@ -943,37 +684,22 @@ const Navbar = () => { ) : ( // Masuk and Daftar buttons for roleId === null
- + {t("logIn")} - +
-

- {t("categoryReg")} -

+

{t("categoryReg")}

{t("selectOne")}

{role?.map((row: any) => (
- setCategory(event.target.value)} - /> + setCategory(event.target.value)} /> @@ -982,11 +708,7 @@ const Navbar = () => {
- + {t("next")}{" "} @@ -1005,14 +727,7 @@ const Navbar = () => {
- + { - router.push(prefixPath + "/image/filter")} - className="flex place-items-start gap-1.5 p-2 w-36" - > + router.push(prefixPath + "/image/filter")} className="flex place-items-start gap-1.5 p-2 w-36">

{t("image")}

- router.push(prefixPath + "/video/filter")} - className="flex items-start gap-1.5 p-2 " - > + router.push(prefixPath + "/video/filter")} className="flex items-start gap-1.5 p-2 "> {pathname?.split("/")[1] == "in" ? ( <>

@@ -1051,19 +760,13 @@ const Navbar = () => { )} - router.push(prefixPath + "/document/filter")} - className="flex place-items-start gap-1.5 p-2" - > + router.push(prefixPath + "/document/filter")} className="flex place-items-start gap-1.5 p-2">

{t("text")}

- router.push(prefixPath + "/audio/filter")} - className="flex place-items-start gap-1.5 p-2 " - > + router.push(prefixPath + "/audio/filter")} className="flex place-items-start gap-1.5 p-2 ">

{t("audio")}{" "} @@ -1075,14 +778,7 @@ const Navbar = () => { - + { - + {

*/} @@ -1207,11 +890,7 @@ const Navbar = () => {
- + setOnSearch(e.target.value)} type="text" placeholder="Search..." className="pl-8 pr-4 py-1 w-28 text-[13px] border rounded-full focus:outline-none dark:text-white" />{" "}
{/* {fullName ? ( @@ -1282,43 +961,22 @@ const Navbar = () => { )} */} - {roleId === "5" || - roleId === "6" || - roleId === "7" || - roleId === "8" ? ( + {roleId === "5" || roleId === "6" || roleId === "7" || roleId === "8" ? ( <> {/* Inbox */} test()}> {" "} - + - - + + - + { {
{notifications?.map((list: any) => ( - +
- ... -
-
- {list?.message} + ...
+
{list?.message}
- {`${new Date(list?.createdAt).getDate()}/${ - new Date(list?.createdAt).getMonth() + 1 - }/${new Date( - list?.createdAt - ).getFullYear()} ${new Date( - list?.createdAt - ).getHours()}:${new Date( + {`${new Date(list?.createdAt).getDate()}/${new Date(list?.createdAt).getMonth() + 1}/${new Date(list?.createdAt).getFullYear()} ${new Date(list?.createdAt).getHours()}:${new Date( list?.createdAt ).getMinutes()}`}{" "} @@ -1383,10 +1019,7 @@ const Navbar = () => { ))} -

+

{t("seeAll")}

@@ -1395,33 +1028,15 @@ const Navbar = () => {
{notificationsUpdate?.map((list: any) => ( - +
- ... + ...
-
- {list?.message} -
+
{list?.message}
- {`${new Date(list?.createdAt).getDate()}/${ - new Date(list?.createdAt).getMonth() + 1 - }/${new Date( - list?.createdAt - ).getFullYear()} ${new Date( - list?.createdAt - ).getHours()}:${new Date( + {`${new Date(list?.createdAt).getDate()}/${new Date(list?.createdAt).getMonth() + 1}/${new Date(list?.createdAt).getFullYear()} ${new Date(list?.createdAt).getHours()}:${new Date( list?.createdAt ).getMinutes()}`}{" "} @@ -1430,10 +1045,7 @@ const Navbar = () => { ))} -

+

{t("seeAll")}

@@ -1446,20 +1058,10 @@ const Navbar = () => { {detail !== undefined ? (
- {"Image"} + {"Image"}
-
- {detail?.fullname} -
-

- ({detail?.fullname}) -

+
{detail?.fullname}
+

({detail?.fullname})

@@ -1483,11 +1085,7 @@ const Navbar = () => { href: "/content-management/galery", }, ].map((item, index) => ( - + {item.name} @@ -1499,11 +1097,7 @@ const Navbar = () => {
- @@ -1513,42 +1107,22 @@ const Navbar = () => { - ) : roleId === "2" || - roleId === "3" || - roleId === "4" || - roleId === "9" || - roleId === "10" || - roleId === "11" || - roleId === "12" || - roleId === "13" ? ( + ) : roleId === "2" || roleId === "3" || roleId === "4" || roleId === "9" || roleId === "10" || roleId === "11" || roleId === "12" || roleId === "13" ? ( <> {/* Inbox */} test()}> {" "} - + - - + + { { -
+
{notifications?.map((list: any) => (
- ... + ...
-
- {list?.message} -
+
{list?.message}
- {`${new Date(list?.createdAt).getDate()}/${ - new Date(list?.createdAt).getMonth() + 1 - }/${new Date( - list?.createdAt - ).getFullYear()} ${new Date( - list?.createdAt - ).getHours()}:${new Date( + {`${new Date(list?.createdAt).getDate()}/${new Date(list?.createdAt).getMonth() + 1}/${new Date(list?.createdAt).getFullYear()} ${new Date(list?.createdAt).getHours()}:${new Date( list?.createdAt ).getMinutes()}`}{" "} @@ -1617,39 +1172,17 @@ const Navbar = () => {

-
+
{notificationsUpdate?.map((list: any) => ( - +
- ... + ...
-
- {list?.message} -
+
{list?.message}
- {`${new Date(list?.createdAt).getDate()}/${ - new Date(list?.createdAt).getMonth() + 1 - }/${new Date( - list?.createdAt - ).getFullYear()} ${new Date( - list?.createdAt - ).getHours()}:${new Date( + {`${new Date(list?.createdAt).getDate()}/${new Date(list?.createdAt).getMonth() + 1}/${new Date(list?.createdAt).getFullYear()} ${new Date(list?.createdAt).getHours()}:${new Date( list?.createdAt ).getMinutes()}`}{" "} @@ -1658,10 +1191,7 @@ const Navbar = () => { ))} -

+

{t("seeAll")}

@@ -1674,20 +1204,10 @@ const Navbar = () => { {detail !== undefined ? (
- {"Image"} + {"Image"}
-
- {detail?.fullname} -
-

- ({detail?.fullname}) -

+
{detail?.fullname}
+

({detail?.fullname})

@@ -1711,11 +1231,7 @@ const Navbar = () => { href: "/dashboard", }, ].map((item, index) => ( - + {item.name} @@ -1727,11 +1243,7 @@ const Navbar = () => {
- @@ -1744,39 +1256,22 @@ const Navbar = () => { ) : ( // Masuk and Daftar buttons for roleId === null
- + {t("logIn")} - +
-

- {t("categoryReg")} -

+

{t("categoryReg")}

{t("selectOne")}

{role?.map((row: any) => (
- - setCategory(event.target.value) - } - /> + setCategory(event.target.value)} /> @@ -1785,11 +1280,7 @@ const Navbar = () => {
- + {t("next")}{" "} diff --git a/components/landing-page/new-content.tsx b/components/landing-page/new-content.tsx index 1eaec973..0d201304 100644 --- a/components/landing-page/new-content.tsx +++ b/components/landing-page/new-content.tsx @@ -2,13 +2,7 @@ import React, { useEffect, useState } from "react"; import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { - Carousel, - CarouselContent, - CarouselItem, - CarouselNext, - CarouselPrevious, -} from "@/components/ui/carousel"; +import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "@/components/ui/carousel"; import { useParams, usePathname } from "next/navigation"; import { Icon } from "@iconify/react/dist/iconify.js"; import { formatDateToIndonesian, secondToTimes } from "@/utils/globals"; @@ -31,11 +25,7 @@ const NewContent = (props: { group: string; type: string }) => { const satkerName = params?.satker_name; const t = useTranslations("LandingPage"); - let prefixPath = poldaName - ? `/polda/${poldaName}` - : satkerName - ? `/satker/${satkerName}` - : "/"; + let prefixPath = poldaName ? `/polda/${poldaName}` : satkerName ? `/satker/${satkerName}` : "/"; useEffect(() => { const timer = setTimeout(() => { @@ -55,26 +45,8 @@ const NewContent = (props: { group: string; type: string }) => { page: 0, size: 5, sortBy: props.type == "popular" ? "clickCount" : "createdAt", - contentTypeId: - selectedTab == "image" - ? "1" - : selectedTab == "video" - ? "2" - : selectedTab == "text" - ? "3" - : selectedTab == "audio" - ? "4" - : "", - group: - props.group == "mabes" - ? "" - : props.group == "polda" && poldaName && String(poldaName)?.length > 1 - ? poldaName - : props.group == "satker" && - satkerName && - String(satkerName)?.length > 1 - ? "satker-" + satkerName - : "", + contentTypeId: selectedTab == "image" ? "1" : selectedTab == "video" ? "2" : selectedTab == "text" ? "3" : selectedTab == "audio" ? "4" : "", + group: props.group == "mabes" ? "" : props.group == "polda" && poldaName && String(poldaName)?.length > 1 ? poldaName : props.group == "satker" && satkerName && String(satkerName)?.length > 1 ? "satker-" + satkerName : "", isInt: locale == "en" ? true : false, }; const response = await getListContent(request); @@ -96,35 +68,22 @@ const NewContent = (props: { group: string; type: string }) => { `; - const toBase64 = (str: string) => - typeof window === "undefined" - ? Buffer.from(str).toString("base64") - : window.btoa(str); + const toBase64 = (str: string) => (typeof window === "undefined" ? Buffer.from(str).toString("base64") : window.btoa(str)); return (
-
+

{pathname?.split("/")[1] == "in" ? ( <> {t("content")}  - {props.type == "popular" - ? "Terpopuler" - : props.type == "latest" - ? t("new") - : "Serupa"} + {props.type == "popular" ? "Terpopuler" : props.type == "latest" ? t("new") : "Serupa"} ) : ( <> - - {props.type == "popular" - ? "Popular" - : props.type == "latest" - ? t("new") - : "Serupa"} - + {props.type == "popular" ? "Popular" : props.type == "latest" ? t("new") : "Serupa"}   {t("content")} @@ -138,27 +97,21 @@ const NewContent = (props: { group: string; type: string }) => { > {t("image")} -
- | -
+
|
{t("video")} -
- | -
+
|
{t("text")} -
- | -
+
|
{
{selectedTab == "image" ? ( newContent?.length > 0 ? ( - + {newContent?.map((image: any) => ( - -
- router.push( - prefixPath + `/image/detail/${image?.slug}` - ) - } - className="cursor-pointer relative group overflow-hidden shadow-md hover:shadow-lg" - > + +
router.push(prefixPath + `/image/detail/${image?.slug}`)} className="cursor-pointer relative group overflow-hidden shadow-md hover:shadow-lg"> image -
-

- {image?.title} -

+
+

{image?.title}

- {formatDateToIndonesian( - new Date(image?.createdAt) - )}{" "} - {image?.timezone ? image?.timezone : "WIB"} |{" "} - {" "} - {image.clickCount}{" "} + {formatDateToIndonesian(new Date(image?.createdAt))} {image?.timezone ? image?.timezone : "WIB"} | {image.clickCount}{" "}

@@ -230,13 +160,7 @@ const NewContent = (props: { group: string; type: string }) => { ) : (

- empty + empty

) ) : selectedTab == "audio" ? ( @@ -244,27 +168,14 @@ const NewContent = (props: { group: string; type: string }) => { {newContent?.map((audio: any) => ( - +
- router.push( - prefixPath + `/audio/detail/${audio?.slug}` - ) - } + onClick={() => router.push(prefixPath + `/audio/detail/${audio?.slug}`)} className="cursor-pointer flex flex-row sm:flex-row items-center bg-white dark:bg-gray-800 shadow-md border rounded-lg p-4 my-3 gap-4 w-full " >
- + {
- {formatDateToIndonesian( - new Date(audio?.createdAt) - )}{" "} - {audio?.timezone ? audio?.timezone : "WIB"}{" "} - | {" "} - + {formatDateToIndonesian(new Date(audio?.createdAt))} {audio?.timezone ? audio?.timezone : "WIB"} |    {audio?.clickCount}{" "}
-
- {audio?.title} -
-

- {" "} - {audio?.duration - ? secondToTimes(Number(audio?.duration)) - : "00:00:00"} -

+
{audio?.title}
+

{audio?.duration ? secondToTimes(Number(audio?.duration)) : "00:00:00"}

@@ -306,13 +201,7 @@ const NewContent = (props: { group: string; type: string }) => { ) : (

- empty + empty

) ) : selectedTab == "video" ? ( @@ -320,22 +209,10 @@ const NewContent = (props: { group: string; type: string }) => { {newContent?.map((video: any) => ( - -
- router.push( - prefixPath + `/video/detail/${video?.slug}` - ) - } - className="cursor-pointer relative group rounded-md overflow-hidden shadow-md hover:shadow-lg" - > + +
router.push(prefixPath + `/video/detail/${video?.slug}`)} className="cursor-pointer relative group rounded-md overflow-hidden shadow-md hover:shadow-lg"> video { className="w-full h-40 lg:h-60 object-cover rounded-lg group-hover:scale-100 transition-transform duration-300" />
-

- {video?.title} -

+

{video?.title}

- {formatDateToIndonesian( - new Date(video?.createdAt) - )}{" "} - {video?.timezone ? video?.timezone : "WIB"}|{" "} - {" "} - {video?.clickCount}{" "} + {formatDateToIndonesian(new Date(video?.createdAt))} {video?.timezone ? video?.timezone : "WIB"}| {video?.clickCount}{" "}

@@ -368,40 +234,18 @@ const NewContent = (props: { group: string; type: string }) => { ) : (

- empty + empty

) ) : newContent.length > 0 ? ( {newContent?.map((text: any) => ( - +
-
- router.push( - prefixPath + `/document/detail/${text?.slug}` - ) - } - className="flex flex-row bg-yellow-500 sm:flex-row items-center dark:bg-gray-800 cursor-pointer shadow-md rounded-lg p-4 gap-4" - > +
router.push(prefixPath + `/document/detail/${text?.slug}`)} className="flex flex-row bg-yellow-500 sm:flex-row items-center dark:bg-gray-800 cursor-pointer shadow-md rounded-lg p-4 gap-4">
- + {
- {formatDateToIndonesian( - new Date(text?.createdAt) - )} + {formatDateToIndonesian(new Date(text?.createdAt))} {text?.timezone ? text?.timezone : "WIB"}| - + {text?.clickCount}
-
- {text?.title} -
+
{text?.title}
- - + + Download {t("document")}
@@ -450,27 +278,14 @@ const NewContent = (props: { group: string; type: string }) => { ) : (

- empty + empty

)}
)}
-
- router.push( - prefixPath + `/${selectedTab}/filter?sortBy=${props.type}` - ) - } - className="cursor-pointer border text-[#bb3523] rounded-lg text-sm lg:text-md px-4 py-1 border-[#bb3523]" - > +
router.push(prefixPath + `/${selectedTab}/filter?sortBy=${props.type}`)} className="cursor-pointer border text-[#bb3523] rounded-lg text-sm lg:text-md px-4 py-1 border-[#bb3523]"> {t("seeAll")}