import Link from "next/link"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { UploadForm } from "@/components/upload-form"; import { api, unwrap } from "@/lib/api"; /** Uploading to one of the approved catalogs: a new product, or with product, a new revision of it. */ export async function UploadCard({ title, product }: { title: string; product?: string }) { const { catalogs } = await api.catalogs.get().then(unwrap); const approved = catalogs.filter((c) => c.status === "approved").map((c) => ({ id: c.id, name: c.name })); return ( {title} {approved.length > 0 ? ( ) : (

No catalogs to upload to yet. See{" "} catalogs .

)}
); }