import { useState } from "react"
import DiscriminationTab01 from "./discriminationtab/DiscriminationTab01";
import DiscriminationTab02 from "./discriminationtab/DiscriminationTab02";
import DiscriminationTab04 from "./discriminationtab/DiscriminationTab04";
import DiscriminationTab05 from "./discriminationtab/DiscriminationTab05";
import DiscriminationTab06 from "./discriminationtab/DiscriminationTab06";
import DiscriminationTab03 from "./discriminationtab/DiscriminationTab03";

const buttonMenu = [
    {id: 1, name: '軒'},
    {id: 2, name: 'ケラバ'},
    {id: 3, name: '壁'},
    {id: 4, name: '八作屋根'},
    {id: 5, name: '半折'},
    {id: 6, name: '片側の流れ'},
]

export default function ShapeTab04() {
    const [buttonAct, setButtonAct] = useState(1);
    return(
        <div className="setting-box">
            <div className="discrimination-tab">
                <div className="modal-btn-wrap sub">
                    {buttonMenu.map((item) => (
                        <button 
                        className={`btn-frame sub-tab ${buttonAct === item.id ? 'act' : ''}`} 
                        onClick={() => setButtonAct(item.id)}
                        >
                            {item.name}
                        </button>
                    ))}
                </div>
            </div>
            <div className="discrimination-box">
                {buttonAct === 1 && <DiscriminationTab01/>}
                {buttonAct === 2 && <DiscriminationTab02/>}
                {buttonAct === 3 && <DiscriminationTab03/>}
                {buttonAct === 4 && <DiscriminationTab04/>}
                {buttonAct === 5 && <DiscriminationTab05/>}
                {buttonAct === 6 && <DiscriminationTab06/>}
            </div>
            <div className="grid-btn-wrap">
                <button className="btn-frame sub-tab mr5">一変戦に戻る</button>
                <button className="btn-frame sub-tab act">適用</button>
            </div>
        </div>
    )
}