"use client"; import { motion } from "framer-motion"; import { useTranslations } from "next-intl"; import { Award } from "lucide-react"; import { normativeData } from "@/lib/demoData"; import httpClient from "@/request/api"; import { endPoints } from "@/request/links"; import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import PaginationLite from "@/components/paginationUI"; import { CertCardSkeleton } from "./loading/loading"; export function NormativeCard() { const t = useTranslations(); const [currentPage, setCurrentPage] = useState(1); const { data, isLoading } = useQuery({ queryKey: ["normativeData"], queryFn: () => httpClient(endPoints.normative), 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 || normativeData; if (isLoading) return ; return (
{generallyData.map((c: any, i: number) => ( {/* Meta + actions */}
{/* Badge row */}
{t("about.certificatePage.card.badge")}
{c.artikul}
{/* Title */}

{t(c.title)}

{/* Divider */}
{/* Documents list */}
    {c.features.map((doc: any, di: number) => (
  • {t(doc?.name)}

  • ))}
))}
{data?.total_pages > 1 && ( )}
); }