import React, { useEffect, useState } from 'react'
import { useForm, Head, Link } from '@inertiajs/react'
import { isEmpty } from 'lodash'
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout'
import Button from '@/Components/Button'
import FormInput from '@/Components/FormInput'
import FormInputNumeric from '@/Components/FormInputNumeric'
export default function Form(props) {
const { customer, levels } = props
const { data, setData, post, processing, errors, reset, clearErrors } =
useForm({
level: customer.level.key,
paylater_limit: +customer.paylater?.limit,
day_deadline: +customer?.paylater?.day_deadline,
})
const handleOnChange = (event) => {
setData(
event.target.name,
event.target.type === 'checkbox'
? event.target.checked
? 1
: 0
: event.target.value
)
}
const handleSubmit = () => {
post(route('customer-verification.update', customer))
}
return (
Customer | : | {customer.fullname} ( {customer.username}) |
: | {customer.phone} |
{errors.level}
)}