import { Form, Head, Link } from '@inertiajs/react'; import { ArrowLeft } from 'lucide-react'; import InputError from '@/components/input-error'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Checkbox } from '@/components/ui/checkbox'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { index as rolesIndex, store } from '@/routes/admin/settings/roles'; type PermissionsByModule = Record; type Props = { permissions: PermissionsByModule; }; const moduleLabels: Record = { user: 'Pengguna', category: 'Kategori', supplier: 'Supplier', customer: 'Customer', 'cash-account': 'Kas Toko', expense: 'Pengeluaran', 'employee-advance': 'Kasbon', 'payroll-period': 'Periode Gaji', payroll: 'Gaji', 'payroll-adjustment': 'Adjustment Gaji', 'leave-request': 'Cuti', attendance: 'Absensi', settings: 'Pengaturan', }; const actionLabels: Record = { view: 'Lihat', create: 'Tambah', update: 'Edit', delete: 'Hapus', 'toggle-active': 'Aktif/Nonaktif', 'reset-password': 'Reset Kata Sandi', deposit: 'Setor', withdrawal: 'Tarik', approve: 'Setujui', pay: 'Bayar', reject: 'Tolak', current: 'Periode Saat Ini', close: 'Tutup', reopen: 'Buka Kembali', cancel: 'Batalkan', 'check-in': 'Check In', 'check-out': 'Check Out', 'by-date': 'Lihat Per Tanggal', show: 'Detail', 'update-system': 'Update Sistem', 'update-homepage': 'Update Homepage', 'update-social-media': 'Update Media Sosial', 'update-marketplace': 'Update Marketplace', 'update-hr': 'Update HR', }; export default function RoleCreate({ permissions }: Props) { return ( <>

Tambah Role

{({ errors, processing }) => ( <>
Informasi Role
Permission {Object.entries(permissions).map( ([module, actions]) => (
{actions.map( (action) => ( ), )}
), )}
)}
); }