'use client' import { SurveyBasicRequest } from '@/types/Survey' import { useRouter } from 'next/navigation' import { useState } from 'react' const defaultBasicInfoForm: SurveyBasicRequest = { representative: '', store: null, construction_point: null, investigation_date: null, building_name: null, customer_name: null, post_code: null, address: null, address_detail: null, submission_status: false, submission_date: null, } export default function BasicForm() { const [basicInfoData, setBasicInfoData] = useState(defaultBasicInfoForm) const handleChange = (key: keyof SurveyBasicRequest, value: string) => { setBasicInfoData({ ...basicInfoData, [key]: value }) } const router = useRouter() const handleSave = () => { console.log('save') } const handleDelete = () => { console.log('delete') } return ( <>
担当者名
handleChange('representative', e.target.value)} />
販売店
handleChange('store', e.target.value)} />
施工店
handleChange('construction_point', e.target.value)} />
現地調査日
handleChange('investigation_date', e.target.value)} />
建物名
handleChange('building_name', e.target.value)} />
顧客名
handleChange('customer_name', e.target.value)} />
建物の住所
市区町村名, 以後の住所
) }