import WithDraggable from '@/components/common/draggable/WithDraggable'
import { useMessage } from '@/hooks/useMessage'
import { usePropertiesSetting } from '@/hooks/roofcover/usePropertiesSetting'

export default function PropertiesSetting(props) {
  const { getMessage } = useMessage()
  const { id, pos = { x: 50, y: 230 } } = props
  const { handleSetEaves, handleSetGable, handleRollback, handleFix, closeModal } = usePropertiesSetting(id)

  return (
    <WithDraggable isShow={true} pos={pos} className="ssm">
      <WithDraggable.Header title={getMessage('modal.canvas.setting.wallline.properties.setting')} onClose={() => closeModal(id)} />
      <WithDraggable.Body>
        <div className="properties-guide">{getMessage('modal.canvas.setting.wallline.properties.setting.info')}</div>
        <div className="properties-setting-wrap">
          <div className="setting-tit">{getMessage('setting')}</div>
          <div className="setting-btn-wrap">
            <button className="setting-btn green mr5" onClick={handleSetEaves}>
              {getMessage('modal.canvas.setting.wallline.properties.setting.eaves')}
            </button>
            <button className="setting-btn blue" onClick={handleSetGable}>
              {getMessage('modal.canvas.setting.wallline.properties.setting.edge')}
            </button>
          </div>
        </div>
        <div className="grid-btn-wrap">
          <button className="btn-frame modal mr5" onClick={handleRollback}>
            {getMessage('modal.cover.outline.rollback')}
          </button>
          <button className="btn-frame modal act" onClick={() => handleFix()}>
            {getMessage('modal.cover.outline.finish')}
          </button>
        </div>
      </WithDraggable.Body>
    </WithDraggable>
  )
}
