<script setup lang="ts">
import BackButton from '@/components/button/BackButton.vue';
import AdminLayout from '@/layouts/AdminLayout.vue';
import type { EnumOption } from '@/types/employee';
import { Head } from '@inertiajs/vue3';
import EmployeeForm from './form/EmployeeForm.vue';
import { index, store } from '@/routes/admin/hr/employees';

defineProps<{
    genders: EnumOption[];
    employmentStatuses: EnumOption[];
    roles: EnumOption[];
}>();
</script>

<template>
    <Head title="Tambah Pegawai" />

    <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 Pegawai
                </h2>
            </div>

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

        <EmployeeForm
            :submit-url="store.url()"
            :genders="genders"
            :employment-statuses="employmentStatuses"
            :roles="roles"
        />
    </AdminLayout>
</template>
