diff --git a/src/app/_components/services/page.tsx b/src/app/_components/services/page.tsx index 5af75a5..8f4a17c 100644 --- a/src/app/_components/services/page.tsx +++ b/src/app/_components/services/page.tsx @@ -5,7 +5,7 @@ import Skeleton from "react-loading-skeleton"; import "react-loading-skeleton/dist/skeleton.css"; type Service = { - id: number; // افزودن id برای شناسایی هر سرویس + id: number; title: string; description: string; imageSrc: string; @@ -21,7 +21,7 @@ export default function Services() { const fetchServices = async () => { try { const response = await fetch("/api/services", { - cache: "no-store", // غیرفعال کردن کش + cache: "no-store", }); if (!response.ok) { @@ -40,34 +40,35 @@ export default function Services() { fetchServices(); }, []); - if (loading) { - return ( -
- Lorem ipsum dolor sit amet consectetur. Tristique amet sed massa nibh - lectus netus in. Aliquet donec morbi convallis pretium -
-
+ {loading ? (
+
Error: {error}
; @@ -81,27 +82,13 @@ export default function Services() { Lorem ipsum dolor sit amet consectetur. Tristique amet sed massa nibh lectus netus in. Aliquet donec morbi convallis pretium -- {service.description} -
-