diff --git a/web/src/components/BarberList.tsx b/web/src/components/BarberList.tsx new file mode 100644 index 0000000..1c68c2d --- /dev/null +++ b/web/src/components/BarberList.tsx @@ -0,0 +1,44 @@ +import { Card } from './ui/card'; +import { Barber } from '../types'; +import { User, Scissors } from 'lucide-react'; + +export const BarberList = ({ barbers }: { barbers: Barber[] }) => ( +
+ {barbers.map((b) => ( + +
+
+ {b.imageUrl ? ( + {b.name} + ) : ( + + )} +
+
+ +
+
+ +
+

{b.name}

+
+ {b.specialties.map((spec, i) => ( + + {spec} + + ))} + {b.specialties.length === 0 && ( + Especialista em tudo + )} +
+
+
+ ))} + {barbers.length === 0 && ( +
+ +

Esta barbearia ainda não registou barbeiros.

+
+ )} +
+); diff --git a/web/src/pages/ShopDetails.tsx b/web/src/pages/ShopDetails.tsx index a734ffc..8356440 100644 --- a/web/src/pages/ShopDetails.tsx +++ b/web/src/pages/ShopDetails.tsx @@ -9,6 +9,7 @@ import { useMemo, useState } from 'react'; import { Tabs } from '../components/ui/tabs'; import { ServiceList } from '../components/ServiceList'; import { ProductList } from '../components/ProductList'; +import { BarberList } from '../components/BarberList'; import { Button } from '../components/ui/button'; import { useApp } from '../context/AppContext'; import { Dialog } from '../components/ui/dialog'; @@ -18,7 +19,7 @@ export default function ShopDetails() { const { id } = useParams<{ id: string }>(); const { shops, shopsReady, addToCart, toggleFavorite, isFavorite } = useApp(); const shop = useMemo(() => shops.find((s) => s.id === id), [shops, id]); - const [tab, setTab] = useState<'servicos' | 'produtos'>('servicos'); + const [tab, setTab] = useState<'servicos' | 'produtos' | 'barbeiros'>('servicos'); const [imageOpen, setImageOpen] = useState(false); if (!shopsReady) { @@ -92,6 +93,7 @@ export default function ShopDetails() { + ) : tab === 'barbeiros' ? ( + ) : ( addToCart({ shopId: shop.id, type: 'product', refId: pid, qty: 1 })} /> )}