import React from 'react' import { Head, useForm, Link, router } from '@inertiajs/react' import { FcGoogle } from 'react-icons/fc' import CustomerLayout from '@/Layouts/CustomerLayout' import FormInput from '@/Components/FormInput' import Button from '@/Components/Button' import Alert from '@/Components/Alert' import FormInputWith from '@/Components/FormInputWith' import TextArea from '@/Components/TextArea' import FormFile from '@/Components/FormFile' export default function Index({ auth: { user }, flash }) { const { data, setData, post, processing, errors } = useForm({ username: user.username, password: '', password_confirmation: '', fullname: user.fullname, name: user.name, address: user.address, phone: user.phone, image: null, image_url: user.image_url, }) const handleOnChange = (event) => { setData( event.target.name, event.target.type === 'checkbox' ? event.target.checked ? 1 : 0 : event.target.value ) } const handleSubmit = () => { post(route('customer.profile.show'), { onSuccess: () => setTimeout(() => router.get(route(route().current())), 3000), }) } const handleKeyDown = (e) => { if (e.code === 'Enter') { handleSubmit() } } return (
Profile
{flash.message.message}
handleKeyDown(e)} label="nama lengkap" />
handleKeyDown(e)} label="nama panggilan" />
+62
} placeholder="whatsapp" name="phone" value={data.phone} onChange={handleOnChange} error={errors.phone} onKeyDownCapture={(e) => handleKeyDown(e)} formClassName={'pl-10'} label="whatsapp" />