fix: link hred in image-filter-card

This commit is contained in:
Sabda Yagra 2025-09-19 09:52:32 +07:00
parent f50d37f4de
commit 9cf5498c88
5 changed files with 40 additions and 31 deletions

View File

@ -54,7 +54,7 @@ export default function FilterAudioComponent(props: {
? `/polda/${poldaName}`
: satkerName
? `/satker/${satkerName}`
: "/";
: "";
useEffect(() => {
if (searchType === "regional") {
@ -242,10 +242,11 @@ export default function FilterAudioComponent(props: {
<CarouselContent>
{newContent?.map((audio: any) => (
<CarouselItem key={audio?.id} className="md:basis-1/2 lg:basis-1/3">
<div
onClick={() =>
router.push(prefixPath + `/audio/detail/${audio?.slug}`)
}
<Link
href={prefixPath + `/audio/detail/${audio?.slug}`}
// onClick={() =>
// router.push(prefixPath + `/audio/detail/${audio?.slug}`)
// }
className="cursor-pointer bg-white dark:bg-black dark:border dark:border-gray-500 rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300 overflow-hidden"
>
{/* Icon Background */}
@ -273,7 +274,7 @@ export default function FilterAudioComponent(props: {
{audio?.title}
</p>
</div>
</div>
</Link>
</CarouselItem>
))}
</CarouselContent>

View File

@ -55,7 +55,7 @@ export default function FilterDocumentComponent(props: {
? `/polda/${poldaName}`
: satkerName
? `/satker/${satkerName}`
: "/";
: "";
useEffect(() => {
if (searchType === "regional") {
@ -213,10 +213,11 @@ export default function FilterDocumentComponent(props: {
<CarouselContent>
{newContent?.map((text: any) => (
<CarouselItem key={text?.id} className="md:basis-1/2 lg:basis-1/3">
<div
onClick={() =>
router.push(prefixPath + `/document/detail/${text?.slug}`)
}
<Link
href={prefixPath + `/document/detail/${text?.slug}`}
// onClick={() =>
// router.push(prefixPath + `/document/detail/${text?.slug}`)
// }
className="cursor-pointer rounded-lg shadow-md overflow-hidden bg-white dark:bg-black dark:border dark:border-gray-500"
>
{/* Ikon di tengah dengan latar kuning */}
@ -246,7 +247,7 @@ export default function FilterDocumentComponent(props: {
{text?.title}
</div>
</div>
</div>
</Link>
</CarouselItem>
))}
</CarouselContent>

View File

@ -157,11 +157,17 @@ export default function FilterImageComponent(props: {
}${endDateString ? `&endDate=${endDateString}` : ""}`;
const href = `${basePath}/image/${fullQuery}`;
// let prefixPath = poldaName
// ? `/polda/${poldaName}`
// : satkerName
// ? `/satker/${satkerName}`
// : "";
let prefixPath = poldaName
? `/polda/${poldaName}`
? `/polda/${poldaName}/image/detail`
: satkerName
? `/satker/${satkerName}`
: "/";
? `/satker/${satkerName}/image/detail`
: `/image/detail`;
return newContent?.length > 0 ? (
<div className="flex flex-col gap-3 w-full">
@ -200,7 +206,7 @@ export default function FilterImageComponent(props: {
{newContent?.map((image: any) => (
<CarouselItem key={image?.id} className="md:basis-1/2 lg:basis-1/3">
<Link
href={prefixPath + `/image/detail/${image?.slug}`}
href={`${prefixPath}/${image?.slug}`}
// onClick={() =>
// router.push(prefixPath + `/image/detail/${image?.slug}`)
// }
@ -212,7 +218,7 @@ export default function FilterImageComponent(props: {
// whileHover={{ scale: 0.95 }}
// transition={{ duration: 0.3 }}
>
{image?.thumbnailLink &&
{image?.thumbnailLink && (
<Image
priority={true}
// placeholder={`data:image/svg+xml;base64,${toBase64(
@ -224,7 +230,7 @@ export default function FilterImageComponent(props: {
src={image?.thumbnailLink}
className="w-full h-full object-cover"
/>
}
)}
</div>
{/* Badge category */}

View File

@ -50,7 +50,7 @@ export default function IndeksCarouselComponent(props: {
? `/polda/${poldaName}`
: satkerName
? `/satker/${satkerName}`
: "/";
: "";
// useEffect(() => {
// initFetch();
@ -166,8 +166,8 @@ export default function IndeksCarouselComponent(props: {
<CarouselContent>
{newContent.map((image: any) => (
<CarouselItem key={image?.id} className="md:basis-1/2 lg:basis-1/3">
<div
onClick={() => router.push(`/indeks/detail/${image?.slug}`)}
<Link href={`/indeks/detail/${image?.slug}`}
// onClick={() => router.push(`/indeks/detail/${image?.slug}`)}
className="cursor-pointer relative group overflow-hidden bg-white dark:bg-black dark:border dark:border-gray-500 rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300"
>
<div className="w-full h-48 lg:h-60">
@ -193,7 +193,7 @@ export default function IndeksCarouselComponent(props: {
</p>
</div>
</div>
</div>
</Link>
</CarouselItem>
))}
</CarouselContent>

View File

@ -55,7 +55,7 @@ export default function FilterVideoComponent(props: {
? `/polda/${poldaName}`
: satkerName
? `/satker/${satkerName}`
: "/";
: "";
useEffect(() => {
if (searchType === "regional") {
@ -160,10 +160,11 @@ export default function FilterVideoComponent(props: {
<CarouselContent>
{newContent?.map((video: any) => (
<CarouselItem key={video?.id} className="md:basis-1/2 lg:basis-1/3">
<div
onClick={() =>
router.push(prefixPath + `/video/detail/${video?.slug}`)
}
<Link
href={prefixPath + `/video/detail/${video?.slug}`}
// onClick={() =>
// router.push(prefixPath + `/video/detail/${video?.slug}`)
// }
className="cursor-pointer relative group overflow-hidden bg-white dark:bg-black dark:border dark:border-gray-500 rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300"
>
{/* Image with motion effect */}
@ -172,7 +173,7 @@ export default function FilterVideoComponent(props: {
// whileHover={{ scale: 0.95 }}
// transition={{ duration: 0.3 }}
>
{video?.thumbnailLink &&
{video?.thumbnailLink && (
<Image
priority={true}
// placeholder={`data:image/svg+xml;base64,${toBase64(
@ -184,7 +185,7 @@ export default function FilterVideoComponent(props: {
src={video?.thumbnailLink}
className="w-full h-full object-cover"
/>
}
)}
</div>
{/* Badge category */}
@ -226,7 +227,7 @@ export default function FilterVideoComponent(props: {
</p>
*/}
</div>
</div>
</Link>
</CarouselItem>
))}
</CarouselContent>