import React from 'react'; import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout'; import { Head, Link, useForm } from '@inertiajs/react'; import { toast } from 'react-toastify'; import { useModalState } from '@/Hooks'; import FormModal from './FormModal'; export default function Dashboard(props) { const { settings, ccs } = props const setting = settings.find(s => s.key === 'DESTINATION_MAIL' ) const { data, setData, post, processing, errors } = useForm({ email: setting.value, }) const ccModal = useModalState() const handleOnChange = (event) => { setData(event.target.name, event.target.type === 'checkbox' ? event.target.checked : event.target.value); } const handleSubmit = () => { post(route('setting.update'), { onSuccess: () => Promise.all([ toast.success('The Data has been saved'), ]), }) } const handleSubmitAndTest = () => { post(route('setting.update', { test: 'test' }), { onSuccess: () => Promise.all([ toast.success('The Data has been saved'), ]), }) } return (
{ccs.map(cc => (
{cc.value}
x
))}
Simpan
Simpan & Test
); }