import { useState } from "react"; import { useParams, useLocation } from "wouter"; import { useQuery } from "@tanstack/react-query"; import { storesApi } from "@/lib/api"; import Header from "@/components/layout/header"; import SellerProductGrid from "@/components/product/seller-product-grid"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; import { Skeleton } from "@/components/ui/skeleton"; import { LoadingSpinner } from "@/components/ui/spinner"; import { ArrowLeft, Star, MapPin, User } from "lucide-react"; export default function StoreDetail() { const { id } = useParams(); const [, setLocation] = useLocation(); const [searchQuery, setSearchQuery] = useState(""); const { data: storeData, isLoading, error } = useQuery({ queryKey: ['/api/stores', id], queryFn: () => storesApi.getById(id!), enabled: !!id, }); if (isLoading) { return (
{[...Array(8)].map((_, i) => ( ))}
); } if (error || !storeData) { return (

Store Not Found

); } return (
{/* Store Banner */}
{storeData.bannerImage ? ( {`${storeData.name} ) : (
)}

{storeData.name}

{/* Store Info */}
{/* Store Face Image */}
{storeData.faceImage ? ( {`${storeData.name} ) : (
No Image
)}

{storeData.name}

{[...Array(5)].map((_, i) => ( ))}
(4.9/5)
{/* Seller Info */}
Seller: {storeData.seller?.username || 'Store Owner'}
{storeData.description && (

About This Store

{storeData.description}

)}
Verified Seller • Bharat
{/* Store Products */}

Products from {storeData.name}

{storeData.products?.length || 0} products
{storeData.products && storeData.products.length > 0 ? ( ) : (

This store doesn't have any products yet.

)}
); }