import { Link } from 'react-router-dom'; import { Store, ChevronRight, Loader2, BadgeCheck } from 'lucide-react'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; import { useSkateShop } from '@/hooks/useSkateShops'; import { parseAddrCoord } from '@/lib/types'; /** * "Sponsored by [Shop]" banner for a crew backed by a local skate shop. * * Renders nothing if the crew has no sponsor, or the referenced shop can't be * resolved — a sponsor should be a real, linkable shop (NIP-15 stall), not a * dangling claim. */ export function CrewSponsorBanner({ sponsorRef }: { sponsorRef: string | undefined }) { const coord = sponsorRef ? parseAddrCoord(sponsorRef) : null; const { data: shop, isLoading } = useSkateShop(coord?.pubkey, coord?.identifier); if (!coord) return null; if (isLoading) { return (
{shop.name}
{shop.location && ({shop.location}
)}