import {useParams} from "react-router-dom";
import {PageHeader} from "../../../component/PageHeader.tsx";
import {useLoadingToast} from "../../../hook/useLoadingToast.ts";
import {ActionButtonFormGroup} from "../../../component/button/ActionButtonFormGroup.tsx";
import {BoardFormTable} from "../components/master/BoardFormTable.tsx";
import {useBoardFormPage} from "../hook/page/useBoardFormPage.ts";

export const BoardFormPage = () => {
    const {bbsId = ''} = useParams();
    const {
        header,
        status,
        form,
        actions,
    } = useBoardFormPage(bbsId);

    useLoadingToast(status);

    return (
        <>
            <PageHeader {...header}/>
            <BoardFormTable {...form}/>
            <ActionButtonFormGroup {...actions}/>
        </>
    );
};
