Merge remote-tracking branch 'origin/iipbs/as/dev' into iipbs/as/dev

This commit is contained in:
2026-05-21 13:13:36 +09:00
31 changed files with 1093 additions and 166 deletions
+4
View File
@@ -14,6 +14,10 @@ export const ENDPOINT = {
ELAPR_TMPLT: "/as-elapr-service/api/v1/elapr-tmplt",
ELAPR_APLN: "/as-elapr-service/api/v1/elapr-apln",
},
AS_CHECKLIST_SERVICE: {
CKLST: "/as-checklist-service/api/v1/cklst",
CKLST_ARTCL: "/as-checklist-service/api/v1/cklst-artcl",
},
CMS_SERVICE: {
CODE: "/cms-service/api/v1/code/cache",
MENU_ROLES: "/cms-service/api/v1/menu-roles",
+10 -8
View File
@@ -1,10 +1,11 @@
import type { HTMLAttributes } from "react";
import type { UseQueryResult } from "@tanstack/react-query";
import { useReactTable, type TableOptions } from "@tanstack/react-table";
import { DataTable } from "@common/components";
import { type TableOptions, useReactTable } from "@tanstack/react-table";
import type { PageResponse } from "@/shared/model";
import { NoData } from "@/shared/ui/no-data";
import { DataTable, Skeleton } from "@common/components";
import { matchQueryStatus } from "./match-query-status";
@@ -21,11 +22,7 @@ interface UseDataTableOptions<T> {
dataTableOptions?: DataTableOptions<T>;
}
export function useDataTable<T>({
query,
tableOptions,
dataTableOptions,
}: UseDataTableOptions<T>) {
export function useDataTable<T>({ query, tableOptions, dataTableOptions }: UseDataTableOptions<T>) {
const table = useReactTable({
...tableOptions,
data: query.data?.content ?? [],
@@ -34,7 +31,12 @@ export function useDataTable<T>({
return {
tableComponent: matchQueryStatus(query, {
Pending: <p className="py-8 text-center text-sm text-muted-foreground">로딩 중…</p>,
Pending: (
<div className="flex flex-col gap-2">
<Skeleton className="h-[4rem]" />
<Skeleton className="h-[16rem]" />
</div>
),
Empty: <NoData />,
Success: () => <DataTable table={table} {...dataTableOptions} />,
}),