import WithDraggable from "@/components/common/draggable/withDraggable";
import { useState } from "react";
import AuxiliaryTab01 from "./AuxiliaryTab01";
import AuxiliaryTab02 from "./AuxiliaryTab02";
import AuxiliaryTab03 from "./AuxiliaryTab03";
import AuxiliaryTab04 from "./AuxiliaryTab04";
import AuxiliaryTab05 from "./AuxiliaryTab05";

const buttonMenu = [
    {id: 1, name: '直線'},
    {id: 2, name: '直角'},
    {id: 3, name: 'イ・グベ'},
    {id: 4, name: '角度'},
    {id: 5, name: '対角線'},
]

export default function AuxiliarylineOption(){
    const [buttonAct, setButtonAct] = useState(1);

    return(
        <WithDraggable isShow={true} size={'r'}>
                <div className="modal-head handle">
                <h1 className="title">補助線の作成</h1>
                    <button className="modal-close">닫기</button>
                </div>
                <div className="modal-body">
                <div className="left-bar handle"></div>
                <div className="right-bar handle"></div>
                    <div className="modal-btn-wrap">
                        {buttonMenu.map((item) => (
                            <button 
                            key={item.id}
                            className={`btn-frame modal ${buttonAct === item.id ? 'act' : ''}`} 
                            onClick={() => setButtonAct(item.id)}
                            >
                                {item.name}
                            </button>
                        ))}
                    </div>
                    <div className="properties-setting-wrap outer">
                        {buttonAct === 1 && <AuxiliaryTab01/>}
                        {buttonAct === 2 && <AuxiliaryTab02/>}
                        {buttonAct === 3 && <AuxiliaryTab03/>}
                        {buttonAct === 4 && <AuxiliaryTab04/>}
                        {buttonAct === 5 && <AuxiliaryTab05/>}
                    </div>
                    <div className="grid-btn-wrap">
                        <button className="btn-frame modal mr5">一変戦に戻る</button>
                        <button className="btn-frame modal mr5">補助線切削</button>
                        <button className="btn-frame modal act">外壁線確定</button>
                    </div>
                </div>
                <div className="modal-foot handle"></div>
        </WithDraggable>
    )
}