This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
"use client";
|
||||
|
||||
export { PostPage as NoticePage } from "@/widgets/post";
|
||||
import { PostPage } from "@/widgets/post";
|
||||
|
||||
export function NoticePage({ bbsId }: { bbsId: string }) {
|
||||
return <PostPage bbsId={bbsId} tableCaption="공지사항 목록" />;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,13 @@ import { columns as tableColumns } from "../model/post-table-columns";
|
||||
import { createColumns as createGridViewColumns } from "../model/grid-view-table-columns";
|
||||
import { SortSelect } from "./sort-select";
|
||||
|
||||
function PostPage({ bbsId }: { bbsId: string }) {
|
||||
function PostPage({
|
||||
bbsId,
|
||||
tableCaption,
|
||||
}: {
|
||||
bbsId: string;
|
||||
tableCaption?: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
const { confirm } = useConfirm();
|
||||
@@ -116,8 +122,6 @@ function PostPage({ bbsId }: { bbsId: string }) {
|
||||
meta: { bbsTypeCd: bbsInfo?.bbsTypeCd },
|
||||
});
|
||||
|
||||
const DataTableComponent = isGridViewPage ? GridViewDataTable : DataTable;
|
||||
|
||||
const onPostDelete = async () => {
|
||||
const selectedPosts = table
|
||||
.getFilteredSelectedRowModel()
|
||||
@@ -245,11 +249,20 @@ function PostPage({ bbsId }: { bbsId: string }) {
|
||||
{isLoading ? (
|
||||
<Skeleton className="h-[36rem] w-full" />
|
||||
) : (
|
||||
<DataTableComponent
|
||||
table={table}
|
||||
onRowClick={handleRowClick}
|
||||
viewPagination
|
||||
/>
|
||||
isGridViewPage ? (
|
||||
<GridViewDataTable
|
||||
table={table}
|
||||
onRowClick={handleRowClick}
|
||||
viewPagination
|
||||
/>
|
||||
) : (
|
||||
<DataTable
|
||||
table={table}
|
||||
onRowClick={handleRowClick}
|
||||
viewPagination
|
||||
caption={tableCaption}
|
||||
/>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user