import WithDraggable from "@/components/common/draggable/withDraggable";
import { useState } from "react";
import ArrangementTab01 from "./ArrangementTab01";
import ArrangementTab02 from "./ArrangementTab02";
import ArrangementTab03 from "./ArrangementTab03";
import ArrangementTab04 from "./ArrangementTab04";
import ArrangementTab05 from "./ArrangementTab05";

export default function ArrangementSetting(){
    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">
                        <button 
                        className={`btn-frame modal ${buttonAct === 1 ? 'act' : ''}`} 
                        onClick={() => setButtonAct(1)}
                        >
                            直線
                        </button>
                        <button 
                        className={`btn-frame modal ${buttonAct === 2 ? 'act' : ''}`} 
                        onClick={() => setButtonAct(2)}
                        >
                            直角
                        </button>
                        <button 
                        className={`btn-frame modal ${buttonAct === 3 ? 'act' : ''}`} 
                        onClick={() => setButtonAct(3)}
                        >
                            イ・グベ
                        </button>
                        <button 
                        className={`btn-frame modal ${buttonAct === 4 ? 'act' : ''}`} 
                        onClick={() => setButtonAct(4)}
                        >
                            角度
                        </button>
                        <button 
                        className={`btn-frame modal ${buttonAct === 5 ? 'act' : ''}`} 
                        onClick={() => setButtonAct(5)}
                        >
                            対角線
                        </button>
                    </div>
                    <div className="properties-setting-wrap outer">
                        {buttonAct === 1 && <ArrangementTab01/>}
                        {buttonAct === 2 && <ArrangementTab02/>}
                        {buttonAct === 3 && <ArrangementTab03/>}
                        {buttonAct === 4 && <ArrangementTab04/>}
                        {buttonAct === 5 && <ArrangementTab05/>}
                    </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>
    )
}