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} 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 && <EavesKerabaTab01/>}
                        {buttonAct === 2 && <EavesKerabaTab02/>}
                        {buttonAct === 3 && <EavesKerabaTab03/>}
                        {buttonAct === 4 && <EavesKerabaTab04/>}
                    </div>
                </div>
                <div className="modal-foot handle"></div>
        </WithDraggable>
    )
}