change content-categor
This commit is contained in:
parent
fbe77eb64b
commit
5cefc299d8
|
|
@ -7,6 +7,7 @@ import { useTranslations } from "next-intl";
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
import { useParams } from "next/navigation";
|
import { useParams } from "next/navigation";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
|
import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "../ui/carousel";
|
||||||
|
|
||||||
const ContentCategory = (props: { group?: string }) => {
|
const ContentCategory = (props: { group?: string }) => {
|
||||||
const [categories, setCategories] = useState<any>();
|
const [categories, setCategories] = useState<any>();
|
||||||
|
|
@ -67,11 +68,12 @@ const ContentCategory = (props: { group?: string }) => {
|
||||||
</h2>
|
</h2>
|
||||||
<div className="h-1 w-52 bg-[#bb3523] mx-auto mb-6 rounded"></div>
|
<div className="h-1 w-52 bg-[#bb3523] mx-auto mb-6 rounded"></div>
|
||||||
|
|
||||||
<div className="grid my-8 grid-cols-1 lg:grid-cols-4 gap-4">
|
<div className="">
|
||||||
{categories?.map((category: any, index: number) =>
|
<Carousel className="w-full max-w-full">
|
||||||
!seeAllValue ? (
|
<CarouselContent>
|
||||||
index < 4 ? (
|
{categories?.map((category: any) => (
|
||||||
<Link key={category?.id} href={`all/filter?category=${category?.id}`} className="relative group rounded-md overflow-hidden shadow-md hover:shadow-lg">
|
<CarouselItem key={category?.id} className="md:basis-1/2 lg:basis-1/3">
|
||||||
|
<Link href={`all/filter?category=${category?.id}`} className="relative group rounded-md overflow-hidden shadow-md hover:shadow-lg block">
|
||||||
{/* Gambar */}
|
{/* Gambar */}
|
||||||
<Image
|
<Image
|
||||||
placeholder={`data:image/svg+xml;base64,${toBase64(shimmer(700, 475))}`}
|
placeholder={`data:image/svg+xml;base64,${toBase64(shimmer(700, 475))}`}
|
||||||
|
|
@ -90,37 +92,18 @@ const ContentCategory = (props: { group?: string }) => {
|
||||||
<h3 className="text-sm font-semibold truncate">{category?.name}</h3>
|
<h3 className="text-sm font-semibold truncate">{category?.name}</h3>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
</CarouselItem>
|
||||||
""
|
))}
|
||||||
)
|
</CarouselContent>
|
||||||
) : (
|
<CarouselPrevious className="-ml-0 lg:-ml-7" />
|
||||||
<Link key={category?.id} href={`all/filter?category=${category?.id}`} className="relative group rounded-md overflow-hidden shadow-md hover:shadow-lg">
|
<CarouselNext className="-mr-0 lg:-mr-7" />
|
||||||
{/* Gambar */}
|
</Carousel>
|
||||||
<Image
|
|
||||||
placeholder={`data:image/svg+xml;base64,${toBase64(shimmer(700, 475))}`}
|
|
||||||
alt="category"
|
|
||||||
width={2560}
|
|
||||||
height={1440}
|
|
||||||
src={category?.thumbnailLink}
|
|
||||||
className="w-full lg:h-[250px] h-40 object-cover group-hover:scale-110 transition-transform duration-300"
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* Overlay Gelap */}
|
|
||||||
<div className="absolute inset-0 bg-black bg-opacity-25 group-hover:bg-opacity-35 transition-all duration-300"></div>
|
|
||||||
|
|
||||||
{/* Judul */}
|
|
||||||
<div className="absolute bottom-5 left-0 right-16 bg-transparent backdrop-blur-md text-white p-4 border-l-2 border-[#bb3523] z-10">
|
|
||||||
<h3 className="text-sm font-semibold truncate">{category?.name}</h3>
|
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
{/* <div className="flex items-center flex-row justify-center">
|
||||||
)
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center flex-row justify-center">
|
|
||||||
<Button onClick={() => setSeeAllValue(!seeAllValue)} className="bg-white hover:bg-[#bb3523] text-[#bb3523] hover:text-white border-2 border-[#bb3523]">
|
<Button onClick={() => setSeeAllValue(!seeAllValue)} className="bg-white hover:bg-[#bb3523] text-[#bb3523] hover:text-white border-2 border-[#bb3523]">
|
||||||
{seeAllValue ? t("seeLess") : t("seeMore")}
|
{seeAllValue ? t("seeLess") : t("seeMore")}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div> */}
|
||||||
</Reveal>
|
</Reveal>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue