import {useAuthorListPage} from "../hook/page/useAuthorListPage.ts";
import {PageHeader} from "../../../component/PageHeader.tsx";
import {ListSearchForm} from "../../../component/ListSearchForm.tsx";
import {ActionButtonListGroup} from "../../../component/button/ActionButtonListGroup.tsx";
import {Pagination} from "../../../component/pagination/Pagination.tsx";
import {AuthorListTable} from "../components/author/AuthorListTable.tsx";
import {useLoadingToast} from "../../../hook/useLoadingToast.ts";

export const AuthorListPage = () => {
    const {
        header,
        status,
        search,
        table,
        actions,
        pagination,
    } = useAuthorListPage();

    useLoadingToast(status);

    return (
        <>
            <PageHeader {...header}/>
            <ListSearchForm
                {...search}
                totalLabel="총 게시물"
            />

            <AuthorListTable {...table}/>

            <ActionButtonListGroup
                {...actions}
                deleteLabel="삭제"
            />
            <Pagination {...pagination}/>
        </>
    )
}
