import WithDraggable from "@/components/common/draggable/withDraggable";
import { useState } from "react";
import ObjectOptionTab01 from "./ObjectOptionTab01";
import ObjectOptionTab02 from "./ObjectOptionTab02";
import ObjectOptionTab03 from "./ObjectOptionTab03";
import ObjectOptionTab04 from "./ObjectOptionTab04";

const buttonMenu = [
    {id: 1, name: '開口部の配置'},
    {id: 2, name: '影の配置'},
    {id: 3, name: '三角形ドーマー'},
    {id: 4, name: '五角形ドーマー'},
]

export default function ObjectOption(){
    const [buttonAct, setButtonAct] = useState(1);
    return(
        <WithDraggable isShow={true} size={'lrr'}>
                <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 && <ObjectOptionTab01/>}
                        {buttonAct === 2 && <ObjectOptionTab02/>}
                        {buttonAct === 3 && <ObjectOptionTab03/>}
                        {buttonAct === 4 && <ObjectOptionTab04/>}
                    </div>
                    <div className="grid-btn-wrap">
                        <button className="btn-frame modal act">作成</button>
                    </div>
                </div>
                <div className="modal-foot handle"></div>
        </WithDraggable>
    )
}