diff --git a/src/app/admin/products/page.tsx b/src/app/admin/products/page.tsx index 55705bd..9f889b8 100644 --- a/src/app/admin/products/page.tsx +++ b/src/app/admin/products/page.tsx @@ -3,6 +3,7 @@ import { getAdminUser } from "@/lib/admin-permissions"; import { getActiveBrandId } from "@/lib/brand-scope"; import AdminAccessDenied from "@/components/admin/AdminAccessDenied"; import ProductsClient from "@/components/admin/ProductsClient"; +import { getBrands } from "@/actions/admin/users"; // Icon for page header const PackageIcon = () => ( @@ -32,6 +33,14 @@ export default async function AdminProductsPage() { const activeBrandId = await getActiveBrandId(adminUser); const brandId = activeBrandId; + const isPlatformAdmin = adminUser.role === "platform_admin"; + + // Platform admins need a brand picker for new products + let brands: { id: string; name: string }[] = []; + if (isPlatformAdmin) { + const result = await getBrands(); + brands = result.brands ?? []; + } let query = supabase .from("products") @@ -71,7 +80,12 @@ export default async function AdminProductsPage() { return (
+ {mode === "add" + ? "Compose a new entry for the harvest catalog — every detail, like a recipe." + : "Refine the details of this entry. The catalog is a living record."} +
++ Delete "{openProduct.name}"? +
++ This will remove the product. If attached to orders, it will be hidden. +
+