<script setup lang="ts">
import { Head, Link } from '@inertiajs/vue3';
import AdminLayout from '@/layouts/AdminLayout.vue';
import RoleForm from './form/RoleForm.vue';
import BackButton from '@/components/button/BackButton.vue';

interface PermissionOption {
    value: string;
    label: string;
    group: string;
}

defineProps<{
    permissions: PermissionOption[];
}>();
</script>

<template>

    <Head title="Tambah Role" />

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

            <BackButton href="/admin/system/roles" />
        </div>

        <RoleForm submit-url="/admin/system/roles" method="post" submit-label="Simpan" :permissions="permissions" />
    </AdminLayout>
</template>
