import { getCategoryData } from "@/service/landing/landing"; import Link from "next/link"; import React, { useEffect, useState } from "react"; import { Button } from "../ui/button"; import { Reveal } from "./Reveal"; const ContentCategory = () => { const [categories, setCategories] = useState(); useEffect(() => { initFetch(); }, []); const initFetch = async () => { const response = await getCategoryData(); console.log("category", response); setCategories(response?.data?.data?.content); }; const [searchTerm, setSearchTerm] = useState(""); const [seeAllValue, setSeeAllValue] = useState(false); return (

Kategori Konten

{categories?.map((category: any, index: number) => !seeAllValue ? ( index < 8 ? (

{category?.name}

) : ( "" ) ) : (

{category?.name}

) )}
); }; export default ContentCategory;