import React from 'react'
import { Head } from '@inertiajs/react'
import { Dropdown } from 'flowbite-react'
import { HiPencil } from 'react-icons/hi'
import { useModalState } from '@/hooks'
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout'
import Pagination from '@/Components/Pagination'
import FormModal from './FormModal'
import { formatIDR, hasPermission } from '@/utils'
export default function Info(props) {
const {
query: { links, data },
auth,
} = props
const formModal = useModalState()
const toggleFormModal = (customerlevel = null) => {
formModal.setData(customerlevel)
formModal.toggle()
}
const canUpdate = hasPermission(auth, 'update-customer-level')
return (
Name | Description | Minimal Deposit | Maximal Deposit | |
---|---|---|---|---|
{level.name} | {level.description} | {formatIDR( level.min_amount )} | {formatIDR( level.max_amount )} |
{canUpdate && (
toggleFormModal(
level
)
}
>
)}
Ubah
|