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

export default function DimensionLineSetting(props) {
  const contextPopupPosition = useRecoilValue(contextPopupPositionState)
  const { id, setIsShow, pos = contextPopupPosition } = props
  const { getMessage } = useMessage()
  const { closePopup } = usePopup()
  const SelectOption01 = [{ name: '0' }, { name: '0' }, { name: '0' }, { name: '0' }]
  return (
    <WithDraggable isShow={true} pos={pos}>
      <div className={`modal-pop-wrap xm`}>
        <div className="modal-head">
          <h1 className="title">表示の変更 </h1>
          <button className="modal-close" onClick={() => closePopup(id)}>
            닫기
          </button>
        </div>
        <div className="modal-body">
          <div className="guide">寸法線に表示する数値を入力してください</div>
          <div className="mb-box">
            <div className="slope-wrap">
              <div className="outline-form mb15">
                <span className="mr10">既存の長さ</span>
                <div className="input-grid mr5">
                  <input type="text" className="input-origin block" defaultValue={5933} readOnly />
                </div>
              </div>
              <div className="mb-box">
                <div className="outline-form">
                  <span className="mr10">変更の長さ</span>
                  <div className="input-grid mr5">
                    <input type="text" className="input-origin block" defaultValue={0} />
                  </div>
                </div>
              </div>
              <div className="d-check-box pop">
                <input type="checkbox" id="ch99" />
                <label htmlFor="ch99">コーナー・ゴールの場合</label>
              </div>
            </div>
          </div>
          <div className="slope-wrap">
            <div className="warning">傾斜を着せてください。</div>
            <div className="display-change-wrap">
              <div className="outline-form mb15">
                <span className="mr10">傾斜</span>
                <div className="grid-select mr10">
                  <QSelectBox title={'0'} option={SelectOption01} />
                </div>
                <span className="thin">寸法</span>
              </div>
              <div className="outline-form">
                <span className="mr10">傾斜</span>
                <div className="grid-select mr10">
                  <QSelectBox title={'0'} option={SelectOption01} />
                </div>
                <span className="thin">寸法</span>
              </div>
            </div>
            <div className="warning">傾き設定されている場合、入力した数値に傾き計算をした数値が表示されます。</div>
          </div>
          <div className="grid-btn-wrap">
            <button className="btn-frame modal act">保存</button>
          </div>
        </div>
      </div>
    </WithDraggable>
  )
}
