import { MetaFunction } from "@remix-run/node"; import { Link, useNavigate } from "@remix-run/react"; import { safeGoBack } from "~/utils/helpers"; import { useGetAllSellerTiles } from "~/requestHandler/use-home-hooks"; import { Skeleton } from "~/components/ui/skeleton"; import { Store, RefreshCw, ArrowRight } from "lucide-react"; export default function Sellers() { const navigate = useNavigate(); const { data, status, refetch } = useGetAllSellerTiles(); const allSellers = data || []; // Loading skeleton const SellersSkeleton = () => (
{Array.from({ length: 8 }).map((_, index) => ( ))}
); // Empty state const EmptyState = () => (

فروشگاهی یافت نشد

در حال حاضر فروشگاهی موجود نیست.

); // Error state const ErrorState = () => (

خطا در بارگذاری فروشگاه‌ها

متاسفانه در بارگذاری فروشگاه‌ها مشکلی پیش آمد.

); const handleBack = () => { safeGoBack(navigate); }; return (
{/* Header (mobile) */}

فروشگاه‌ها

{/* Content */}

فروشگاه‌ها

{status === "pending" ? ( ) : status === "error" ? ( ) : allSellers.length === 0 ? ( ) : (
{allSellers.map((seller, index) => ( {/* Background Image */} {seller.imageUrl ? ( {seller.sellerName ) : (
)} ))}
)}
); } export const meta: MetaFunction = () => { const title = "فروشگاه‌های ویترون | برترین فروشندگان"; const description = "مشاهده برترین فروشگاه‌های ویترون. خرید امن از فروشندگان معتبر با بالاترین کیفیت."; const imageUrl = "https://vitrownstatics.s3.ir-thr-at1.arvanstorage.ir/SVG-06.svg?versionId="; return [ { title }, { name: "description", content: description }, { name: "keywords", content: "فروشگاه، فروشندگان، ویترون، خرید آنلاین، فروشگاه اینترنتی", }, { name: "robots", content: "index, follow" }, // Open Graph { property: "og:type", content: "website" }, { property: "og:title", content: title }, { property: "og:description", content: description }, { property: "og:image", content: imageUrl }, { property: "og:site_name", content: "ویترون" }, { property: "og:locale", content: "fa_IR" }, // Twitter Card { name: "twitter:card", content: "summary_large_image" }, { name: "twitter:title", content: title }, { name: "twitter:description", content: description }, { name: "twitter:image", content: imageUrl }, ]; };