import WithDraggable from "@/components/common/draggable/withDraggable";
import { useState } from "react";
import MovingTab01 from "./MovingTab01";
import MovingTab02 from "./MovingTab02";

const buttonMenu = [
    {id: 1, name: '棟線移動'},
    {id: 2, name: '桁上げ・下げ'},
]

export default function MovingUpDonw(){
    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 && <MovingTab01/>}
                        {buttonAct === 2 && <MovingTab02/>}
                    </div>
                    <div className="grid-btn-wrap">
                        <button className="btn-frame modal act">保存</button>
                    </div>
                </div>
                <div className="modal-foot handle"></div>
        </WithDraggable>
    )
}