'use client'

import { useRecoilValue } from 'recoil'
import { useMessage } from '@/hooks/useMessage'
import WithDraggable from '@/components/common/draggable/WithDraggable'
import { usePopup } from '@/hooks/usePopup'
import { contextPopupPositionState } from '@/store/popupAtom'
import QSelectBox from '@/components/common/select/QSelectBox'

export default function RoofMaterialSetting(props) {
  const contextPopupPosition = useRecoilValue(contextPopupPositionState)
  const { id, pos = contextPopupPosition } = props
  const { getMessage } = useMessage()
  const { closePopup } = usePopup()
  const roofMaterials = [
    { name: '기와1', value: 'material1' },
    { name: '기와2', value: 'material2' },
    { name: '기와3', value: 'material3' },
    { name: '기와4', value: 'material4' },
    { name: '기와5', value: 'material5' },
  ]

  return (
    <WithDraggable isShow={true} pos={pos} className="xxxm">
      <WithDraggable.Header title={getMessage('modal.roof.material.edit')} onClose={() => closePopup(id)} />
      <WithDraggable.Body>
        <div className="slope-wrap">
          <div className="grid-select">
            <QSelectBox title={'지붕재 선택'} options={roofMaterials} />
          </div>
        </div>
        <div className="grid-btn-wrap">
          <button className="btn-frame modal act">{getMessage('modal.common.save')}</button>
        </div>
      </WithDraggable.Body>
    </WithDraggable>
  )
}
