import React from 'react' import { Head, useForm, Link } 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' export default function Index({ referral_code, flash }) { const { data, setData, post, processing, errors } = useForm({ username: '', password: '', password_confirmation: '', fullname: '', name: '', address: '', phone: '', email: '', referral_code: referral_code, }) const handleOnChange = (event) => { setData( event.target.name, event.target.type === 'checkbox' ? event.target.checked ? 1 : 0 : event.target.value ) } const handleSubmit = () => { post(route('customer.register')) } const handleKeyDown = (e) => { if (e.code === 'Enter') { handleSubmit() } } const handleLoginWithGoogle = () => { window.location = route('customer.login.google') } return (
Daftar
{flash.message.message}
handleKeyDown(e)} />
handleKeyDown(e)} />
handleKeyDown(e)} />
+62
} placeholder="whatsapp" name="phone" value={data.phone} onChange={handleOnChange} error={errors.phone} onKeyDownCapture={(e) => handleKeyDown(e)} formClassName={'pl-10'} />