import { useEffect, useState } from "react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; interface Studio { id?: string; name: string; tagline?: string | null; metrics?: string | null; specialties?: string[] | null; rank?: number | null; } export default function FeaturedStudiosGrid() { const [studios, setStudios] = useState([]); const [loading, setLoading] = useState(false); useEffect(() => { (async () => { setLoading(true); try { const res = await fetch("/api/featured-studios"); const data = res.ok ? await res.json() : []; setStudios(Array.isArray(data) ? data : []); } catch { setStudios([]); } finally { setLoading(false); } })(); }, []); if (loading) return (

Loading studios…

); if (!studios.length) return (

No featured studios yet.

); return (
{studios.map((s) => ( {s.name} {s.tagline ? {s.tagline} : null} {s.metrics ? (
{s.metrics}
) : null} {Array.isArray(s.specialties) && s.specialties.length ? (
{s.specialties.map((sp) => ( {sp} ))}
) : null}
))}
); }