코드 관리 빌드 오류 수정
This commit is contained in:
@@ -1,18 +1,40 @@
|
||||
import dayjs from "dayjs";
|
||||
import { type ColumnDef} from "@tanstack/react-table";
|
||||
import { type ColumnDef } from "@tanstack/react-table";
|
||||
import { Button } from "@common/components";
|
||||
import type { UpCode } from "@/entities/code/model/upcode-interface";
|
||||
import type { LwpoCode } from "@/entities/code/model/lwpocode-interface";
|
||||
|
||||
type UpCodeTableMeta = {
|
||||
onManagementClick?: (row: UpCode) => void;
|
||||
const UpCodeManageButton = () => {
|
||||
return (
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
// 클릭 이벤트를 부모로 전파하여 onRowClick이 호출되도록 함
|
||||
e.currentTarget.parentElement?.parentElement?.click();
|
||||
}}
|
||||
>
|
||||
관리
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
type LwpoCodeTableMeta = {
|
||||
onManagementClick?: (row: LwpoCode) => void;
|
||||
const LwpoCodeManageButton = () => {
|
||||
return (
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
// 클릭 이벤트를 부모로 전파하여 onRowClick이 호출되도록 함
|
||||
e.currentTarget.parentElement?.parentElement?.click();
|
||||
}}
|
||||
>
|
||||
관리
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
export const upCodecolumns: ColumnDef<UpCode, UpCodeTableMeta>[] = [
|
||||
|
||||
export const upCodecolumns: ColumnDef<UpCode>[] = [
|
||||
{
|
||||
id: "no",
|
||||
header: "NO",
|
||||
@@ -52,26 +74,13 @@ export const upCodecolumns: ColumnDef<UpCode, UpCodeTableMeta>[] = [
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "management",
|
||||
id: "actions",
|
||||
header: "관리",
|
||||
cell: ({ row, table }) => {
|
||||
const onManagementClick = (table.options.meta as UpCodeTableMeta)?.onManagementClick;
|
||||
return (
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onManagementClick?.(row.original);
|
||||
}}
|
||||
>
|
||||
관리
|
||||
</Button>
|
||||
);
|
||||
},
|
||||
},
|
||||
cell: () => <UpCodeManageButton />,
|
||||
}
|
||||
];
|
||||
|
||||
export const lowCodecolumns: ColumnDef<LwpoCode, LwpoCodeTableMeta>[] = [
|
||||
export const lowCodecolumns: ColumnDef<LwpoCode>[] = [
|
||||
{
|
||||
id: "no",
|
||||
header: "NO",
|
||||
@@ -103,21 +112,8 @@ export const lowCodecolumns: ColumnDef<LwpoCode, LwpoCodeTableMeta>[] = [
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "management",
|
||||
id: "actions",
|
||||
header: "관리",
|
||||
cell: ({ row, table }) => {
|
||||
const onManagementClick = (table.options.meta as LwpoCodeTableMeta)?.onManagementClick;
|
||||
return (
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onManagementClick?.(row.original);
|
||||
}}
|
||||
>
|
||||
관리
|
||||
</Button>
|
||||
);
|
||||
},
|
||||
},
|
||||
cell: () => <LwpoCodeManageButton />,
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user