import WithDraggable from "@/components/common/draggable/withDraggable";
import { useState } from "react";
import ManualTab01 from "./ManualTab01";
import ManualTab02 from "./ManualTab02";
import ManualTab03 from "./ManualTab03";

const buttonMenu = [
    {id: 1, name: '軒'},
    {id: 2, name: 'ケラバ'},
    {id: 3, name: '漂流'},
]

export default function ManualRoofShape(){
    const [buttonAct, setButtonAct] = useState(1);
    return(
        <WithDraggable isShow={true} size={'xxm'}>
                <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="modal-bottom-border-bx">
                        <div className="discrimination-box">
                            {buttonAct === 1 && <ManualTab01/>}
                            {buttonAct === 2 && <ManualTab02/>}
                            {buttonAct === 3 && <ManualTab03/>}
                        </div>
                        <div className="grid-btn-wrap">
                            <button className="btn-frame sub-tab mr5">一変戦に戻る</button>
                            <button className="btn-frame sub-tab act">適用</button>
                        </div>
                    </div>
                    <div className="grid-btn-wrap">
                        <button className="btn-frame modal act">設定完了</button>
                    </div>
                </div>
                <div className="modal-foot handle"></div>
        </WithDraggable>
    )
}