import WithDraggable from "@/components/common/draggable/withDraggable";
import { useState } from "react";
import EavesKerabaTab01 from "./EavesKerabaTab01";
import EavesKerabaTab02 from "./EavesKerabaTab02";
import EavesKerabaTab03 from "./EavesKerabaTab03";
import EavesKerabaTab04 from "./EavesKerabaTab04";

const buttonMenu = [
    {id: 1, name: '軒'},
    {id: 2, name: '直ケラバ角'},
    {id: 3, name: '壁取り'},
    {id: 4, name: '片側の流れ'},
]

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

    return(
        <WithDraggable isShow={true}>
            <div className={`modal-pop-wrap r`}>
                <div className="modal-head">
                <h1 className="title">軒・ケラバ変更</h1>
                    <button className="modal-close">닫기</button>
                </div>
                <div className="modal-body">
                    <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">
                        <div className="setting-tit">設定</div>
                        {buttonAct === 1 && <EavesKerabaTab01/>}
                        {buttonAct === 2 && <EavesKerabaTab02/>}
                        {buttonAct === 3 && <EavesKerabaTab03/>}
                        {buttonAct === 4 && <EavesKerabaTab04/>}
                    </div>
                    <div className="grid-btn-wrap">
                        <button className="btn-frame modal act">保存</button>
                    </div>
                </div>
            </div>
        </WithDraggable>
    )
}