diff --git a/app/[locale]/about/sertificate/page.tsx b/app/[locale]/about/sertificate/page.tsx index 8f757bf..86bcaa4 100644 --- a/app/[locale]/about/sertificate/page.tsx +++ b/app/[locale]/about/sertificate/page.tsx @@ -1,4 +1,5 @@ "use client"; +import { CertCardSkeleton } from "@/components/pages/about/aboutDetail/loading/loading"; import { CertCard } from "@/components/pages/about/aboutDetail/sertificateCard"; import PaginationLite from "@/components/paginationUI"; import { certs } from "@/lib/demoData"; @@ -23,8 +24,7 @@ export default function SertificatePage() { }), }); - console.log(data); - const generallydata = data?.results ?? certs; + const generallydata = data?.results || certs; return (
@@ -88,9 +88,13 @@ export default function SertificatePage() { {/* ── Cards ── */}
- {generallydata.map((c:any, i:number) => ( - - ))} + {isLoading ? ( + + ) : ( + generallydata.map((c: any, i: number) => ( + + )) + )}
{/*pagination*/} diff --git a/components/pages/about/aboutDetail/guides.tsx b/components/pages/about/aboutDetail/guides.tsx index 50a6249..ae77602 100644 --- a/components/pages/about/aboutDetail/guides.tsx +++ b/components/pages/about/aboutDetail/guides.tsx @@ -6,6 +6,7 @@ import { useQuery } from "@tanstack/react-query"; import httpClient from "@/request/api"; import { endPoints } from "@/request/links"; import PaginationLite from "@/components/paginationUI"; +import { DownloadCardSkeleton } from "./loading/guidLoading"; export function Guides() { const t = useTranslations(); @@ -31,7 +32,7 @@ export function Guides() { }, ]; - const { data } = useQuery({ + const { data, isLoading } = useQuery({ queryKey: ["guides"], queryFn: () => httpClient(endPoints.guides), select: (res) => ({ @@ -46,15 +47,19 @@ export function Guides() { return (
- {guidedata.map((guide: any, index: number) => ( - - ))} + {isLoading ? ( + + ) : ( + guidedata.map((guide: any, index: number) => ( + + )) + )}
{data?.total_pages > 1 && ( + {/* Top section */} +
+ {/* Title */} +
+
+
+
+ {/* File type badge */} +
+
+ + {/* Bottom section */} +
+
+
+
+
+ ); +} diff --git a/components/pages/about/aboutDetail/loading.tsx b/components/pages/about/aboutDetail/loading/loading.tsx similarity index 100% rename from components/pages/about/aboutDetail/loading.tsx rename to components/pages/about/aboutDetail/loading/loading.tsx diff --git a/components/pages/about/aboutDetail/normativeCard.tsx b/components/pages/about/aboutDetail/normativeCard.tsx index 7b74472..62bf1fa 100644 --- a/components/pages/about/aboutDetail/normativeCard.tsx +++ b/components/pages/about/aboutDetail/normativeCard.tsx @@ -9,7 +9,7 @@ import { endPoints } from "@/request/links"; import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; import PaginationLite from "@/components/paginationUI"; -import { CertCardSkeleton } from "./loading"; +import { CertCardSkeleton } from "./loading/loading"; export function NormativeCard() { const t = useTranslations(); @@ -25,10 +25,8 @@ export function NormativeCard() { }), }); - console.log(data); + const generallyData = data?.results || normativeData; - const generallyData = data?.results ?? normativeData; - if (isLoading) return ; return (