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

export default function CircuitNumberEdit(props) {
  const contextPopupPosition = useRecoilValue(contextPopupPositionState)
  const { id, pos = contextPopupPosition, apply } = props
  const { closePopup } = usePopup()
  const { getMessage } = useMessage()
  const handleApply = () => {
    if (apply) apply()
    closePopup(id)
  }
  return (
    <WithDraggable isShow={true} pos={pos} className="xm">
      <WithDraggable.Header title={getMessage('modal.module.circuit.number.edit')} onClose={() => closePopup(id)} />
      <WithDraggable.Body>
        <div className="grid-option-tit"> {getMessage('modal.module.circuit.number.edit.info')}</div>
        <div className="grid-option-wrap">
          <div className="grid-option-box">
            <div className="outline-form">
              <span className="mr10" style={{ width: 'auto' }}>
                {getMessage('modal.module.circuit.number')}
              </span>
              <div className="input-grid mr5">
                <input type="text" className="input-origin block" />
              </div>
            </div>
          </div>
        </div>
        <div className="grid-btn-wrap">
          <button className="btn-frame modal act" onClick={handleApply}>
            {getMessage('modal.common.save')}
          </button>
        </div>
      </WithDraggable.Body>
    </WithDraggable>
  )
}
