<script setup lang="ts">
import { Head, Link } from '@inertiajs/vue3';
import AdminLayout from '@/layouts/AdminLayout.vue';
import type { EnumOption } from '@/types/raw-material';
import RawMaterialForm from './form/RawMaterialForm.vue';
import BackButton from '@/components/button/BackButton.vue';
import { index, store } from '@/routes/admin/master/raw_materials';

defineProps<{
    units: EnumOption[];
}>();
</script>

<template>

    <Head title="Tambah Bahan Baku" />

    <AdminLayout>
        <div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
            <div class="space-y-1">
                <h2 class="text-2xl font-bold tracking-tight">
                    Tambah Bahan Baku
                </h2>
            </div>

            <BackButton :href="index.url()" />
        </div>

        <RawMaterialForm :submit-url="store.url()" method="post" submit-label="Simpan" :units="units" />
    </AdminLayout>
</template>
