"use client"; import { CertCardSkeleton } from "@/pages/about/aboutDetail/loading/loading"; import { CertCard } from "@/pages/about/aboutDetail/sertificateCard"; import PaginationLite from "@/components/paginationUI"; import { certs } from "@/lib/demoData"; import httpClient from "@/request/api"; import { endPoints } from "@/request/links"; import { useQuery } from "@tanstack/react-query"; import { motion } from "framer-motion"; import { Award } from "lucide-react"; import { useTranslations } from "next-intl"; import { useState } from "react"; export default function SertificatePage() { const t = useTranslations(); const [currentPage, setCurrentPage] = useState(1); const { data, isLoading } = useQuery({ queryKey: ["sertificate"], queryFn: () => httpClient(endPoints.sertificate), select: (res) => ({ results: res.data?.data?.results, current_page: res.data?.data?.current_page, total_pages: res.data?.data?.total_pages, }), }); const generallydata = data?.results || certs; return (
{/* ── Hero ── */}
{t("about.certificatePage.hero.label")} {t("about.certificatePage.hero.title1")}{" "} {t("about.certificatePage.hero.title2")} {t("about.certificatePage.hero.description")}
{/* ── Count strip ── */} {certs.length}

{t("about.certificatePage.count.description")}

{/* ── Cards ── */}
{isLoading ? ( ) : ( generallydata.map((c: any, i: number) => ( )) )}
{/*pagination*/} {data?.total_pages > 1 && ( )}
); }