import WithDraggable from "@/components/common/draggable/withDraggable";
import Qselect from "@/components/common/select/Qselect";
import { modalState } from "@/store/modalAtom";
import { useState } from "react";
import { useRecoilState } from "recoil";

export default function GridOption() {
    const [modalOption, setModalOption] = useRecoilState(modalState); //modal 열림닫힘 state
    const [close, setClose] = useState(false)

    const SelectOption = [
        {name: '原寸',}, {name: '原寸'}, {name: '原寸'}, {name: '原寸'}
    ]

    const HandleClickClose = () => {
        setClose(true)
        setTimeout(() => {
            setModalOption({...modalOption, gridoption: false})
            setClose(false);
        }, 180)
    }

    
    return(
        <WithDraggable isShow={true} size={'ssm'}>
                <div className="modal-head handle">
                    <h1 className="title">ドット・ライングリッドの設定</h1>
                    <button className="modal-close" onClick={HandleClickClose}>닫기</button>
                </div>
                <div className="modal-body">
                <div className="left-bar handle"></div>
                <div className="right-bar handle"></div>
                    <div className="grid-check-form">
                        <div className="d-check-box pop">
                            <input type="checkbox" id="ch01" />
                            <label htmlFor="ch01">点グリッド表示</label>
                        </div>
                        <div className="d-check-box pop">
                            <input type="checkbox" id="ch02" />
                            <label htmlFor="ch02">ライングリッドの表示</label>
                        </div>
                    </div>
                    <div className="grid-option-wrap">
                        <div className="grid-option-box">
                            <div className="d-check-radio pop no-text">
                                <input type="radio" name="radio01" id="ra01" />
                                <label htmlFor="ra01"></label>
                            </div>
                            <div className="grid-input-form">
                                <span className="mr10">横間隔</span>
                                <div className="input-grid mr5">
                                    <input type="text" className="input-origin" defaultValue={910}/>
                                </div>
                                <span>mm</span>
                            </div>
                            <div className="grid-input-form">
                                <span className="mr10">縦間隔</span>
                                <div className="input-grid mr5">
                                    <input type="text" className="input-origin" defaultValue={910}/>
                                </div>
                                <span>mm</span>
                            </div>
                        </div>
                        <div className="grid-option-box">
                            <div className="d-check-radio pop no-text">
                                <input type="radio" name="radio01" id="ra02" />
                                <label htmlFor="ra02"></label>
                            </div>
                            <div className="grid-input-form">
                                <span className="mr10">比間隔</span>
                                <div className="input-grid mr5">
                                    <input type="text" className="input-origin" defaultValue={910}/>
                                </div>
                                <span>mm</span>
                            </div>
                            <div className="grid-select">
                                <Qselect title={'原寸'} option={SelectOption}/>
                            </div>
                        </div>
                    </div>
                    <div className="grid-btn-wrap">
                        <button className="btn-frame modal mr5">初期化</button>
                        <button className="btn-frame modal act">保存</button>
                    </div>
                </div>
                <div className="modal-foot handle"></div>
        </WithDraggable>
    )
}