import WithDraggable from '@/components/common/draggable/WithDraggable' import Image from 'next/image' import { useState } from 'react' import { useRecoilValue } from 'recoil' import { contextPopupPositionState } from '@/store/popupAtom' import { usePopup } from '@/hooks/usePopup' import { useMessage } from '@/hooks/useMessage' import { MODULE_REMOVE_TYPE, useModule } from '@/hooks/module/useModule' export default function RowRemove(props) { const contextPopupPosition = useRecoilValue(contextPopupPositionState) const { id, pos = contextPopupPosition, apply } = props const { closePopup } = usePopup() const [selectedType, setSelectedType] = useState(MODULE_REMOVE_TYPE.TOP) const { getMessage } = useMessage() const { moduleRowRemove } = useModule() const types = [ { name: getMessage('modal.row.remove.type.up'), value: MODULE_REMOVE_TYPE.TOP }, { name: getMessage('modal.row.remove.type.down'), value: MODULE_REMOVE_TYPE.BOTTOM }, { name: getMessage('modal.row.remove.type.side'), value: MODULE_REMOVE_TYPE.VERTICAL_SIDE }, { name: getMessage('modal.row.remove.type.none'), value: MODULE_REMOVE_TYPE.NONE }, ] const handleApply = () => { // if (apply) apply() moduleRowRemove(selectedType) closePopup(id) } return (

{getMessage('modal.row.remove')}

{getMessage('modal.row.remove.info')}
{types.map((type, index) => { return (
setSelectedType(e.target.value)} value={type.value} checked={selectedType === type.value} />
) })}
{selectedType === MODULE_REMOVE_TYPE.TOP && ( react )} {selectedType === MODULE_REMOVE_TYPE.BOTTOM && ( react )} {selectedType === MODULE_REMOVE_TYPE.VERTICAL_SIDE && ( react )} {selectedType === MODULE_REMOVE_TYPE.NONE && ( react )}
{getMessage('legend')}
{getMessage('modal.panel.select.row')}
) }