import { useMessage } from '@/hooks/useMessage' import { forwardRef, useState } from 'react' const Placement = forwardRef((props, refs) => { const { getMessage } = useMessage() const [isChidori, setIsChidori] = useState('false') const [setupLocation, setSetupLocation] = useState('center') const [isMaxSetup, setIsMaxSetup] = useState('false') const moduleData = { header: [ { type: 'check', name: '', prop: 'check', width: 70 }, { type: 'color-box', name: getMessage('module'), prop: 'module' }, { type: 'text', name: `${getMessage('output')} (W)`, prop: 'output', width: 70 }, ], rows: [ { check: false, module: { name: 'Re.RISE-G3 440', color: '#AA6768' }, output: { name: '440' }, }, { check: false, module: { name: 'Re.RISE MS-G3 290', color: '#67A2AA', }, output: { name: '240' }, }, ], } const handleChangeChidori = (e) => { setIsChidori(e.target.value) refs.isChidori.current = e.target.value } const handleSetupLocation = (e) => { setSetupLocation(e.target.value) refs.setupLocation.current = e.target.value } const handleMaxSetup = (e) => { console.log(e.target.checked) if (e.target.checked) { setIsMaxSetup('true') refs.isMaxSetup.current = 'true' } else { setIsMaxSetup('false') refs.isMaxSetup.current = 'false' } } return ( <>
|
{data.type === 'check' ? (
|
))}
||
|---|---|---|
|
{row[header.prop].name}
|
)}
{header.type === 'check' && (
|
)}
{header.type && header.type !== 'color-box' && header.type !== 'check' && (
{row[header.prop].name} | )} > ))}