@@ -4,7 +4,7 @@ import InputError from '@/components/InputError.vue';
44import AppLayout from ' @/layouts/AppLayout.vue' ;
55import inventory from ' @/routes/admin/inventory' ;
66import { type BreadcrumbItem } from ' @/types' ;
7- import { Form , Head , useForm } from ' @inertiajs/vue3' ;
7+ import { Form , Head } from ' @inertiajs/vue3' ;
88import { Input } from ' @/components/ui/input' ;
99import { Label } from ' @/components/ui/label' ;
1010import { Button } from ' @/components/ui/button' ;
@@ -13,6 +13,11 @@ import Textarea from '@/components/ui/textarea/Textarea.vue';
1313import { Spinner } from ' @/components/ui/spinner' ;
1414import { X , Upload } from ' lucide-vue-next' ;
1515import { useImagePreviews } from ' @/composables/useImagePreviews' ;
16+ import { Supplier } from ' @/types/admin' ;
17+
18+ const props = defineProps <{
19+ suppliers: Supplier [];
20+ }>();
1621
1722const breadcrumbs: BreadcrumbItem [] = [
1823 {
@@ -89,10 +94,12 @@ const { imagePreviews, handleImageSelect, removeImage } = useImagePreviews(3);
8994 <InputError :message =" errors.category" />
9095 </div >
9196
92- <!-- Supplier ID (Placeholder) -->
97+ <!-- Supplier -->
9398 <div class =" space-y-2" >
94- <Label for =" supplier_id" >Supplier ID</Label >
95- <Input id =" supplier_id" name =" supplier_id" placeholder =" Enter supplier ID" type =" number" />
99+ <Label for =" supplier_id" >Supplier</Label >
100+ <Select name =" supplier_id"
101+ :options =" suppliers.map(s => ({ value: s.id.toString(), label: s.supplier_name }))"
102+ placeholder =" Select a supplier (optional)" />
96103 <InputError :message =" errors.supplier_id" />
97104 </div >
98105
0 commit comments