Files

55 lines
2.0 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import AuthenticatedLayout from "@/Layouts/AuthenticatedLayout";
import { Head, Link } from "@inertiajs/react";
import { Package, ArrowLeft } from "lucide-react";
import { Button } from "@/Components/ui/button";
import ProductForm from "@/Components/Product/ProductForm";
import { getCreateBreadcrumbs } from "@/utils/breadcrumb";
import type { Category } from "./Index";
import type { Unit } from "@/Components/Unit/UnitManagerDialog";
interface Props {
categories: Category[];
units: Unit[];
}
export default function Create({ categories, units }: Props) {
return (
<AuthenticatedLayout
breadcrumbs={getCreateBreadcrumbs("products")}
>
<Head title="新增商品" />
<div className="container mx-auto p-6 max-w-7xl">
{/* Header */}
<div className="mb-6">
<Link href={route("products.index")}>
<Button
variant="outline"
className="gap-2 button-outlined-primary mb-4"
>
<ArrowLeft className="h-4 w-4" />
</Button>
</Link>
<div className="mb-4">
<h1 className="text-2xl font-bold text-grey-0 flex items-center gap-2">
<Package className="h-6 w-6 text-primary-main" />
</h1>
<p className="text-gray-500 mt-1">
</p>
</div>
</div>
{/* 表單內容 */}
<ProductForm
categories={categories}
units={units}
/>
</div>
</AuthenticatedLayout >
);
}