Website: products, library, catalogs and their console page
/products (search), product pages with revisions, getting and staying on a revision, retracting; /products/:id/edit; /create and new revisions upload from the browser straight to the catalog with a token from the hub; /library; /catalogs (directory, registering with a once-shown key); /console/catalogs to approve or reject. Every page now sends a nonce-based CSP (proxy.ts), so product descriptions can't run scripts. buttonVariants now merges classes, so outline links get their border. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
b4f6fce9df
commit
51d5bb5ff3
24 files changed
+1064
-5
No files matched your search
@@ -0,0 +1,30 @@
|
||||
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 (
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{title}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{approved.length > 0 ? (
|
||||
<UploadForm catalogs={approved} product={product} />
|
||||
) : (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
No catalogs to upload to yet. See{" "}
|
||||
<Link href="/catalogs" className="text-foreground underline underline-offset-4">
|
||||
catalogs
|
||||
</Link>
|
||||
.
|
||||
</p>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user