From b4e1aaf8855b6cd444ab01e62a62d56454ce5985 Mon Sep 17 00:00:00 2001 From: Christoffer Nguyen Date: Tue, 19 May 2026 13:32:29 +0200 Subject: [PATCH] Fix types --- lego-webapp/components/Table/index.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lego-webapp/components/Table/index.tsx b/lego-webapp/components/Table/index.tsx index 1fadbd0606..852e5e5826 100644 --- a/lego-webapp/components/Table/index.tsx +++ b/lego-webapp/components/Table/index.tsx @@ -24,7 +24,7 @@ export type EditDraft = Record & Partial>; export type EditErrors = Record; -export type RowActionContext = { +export type RowActionContext = { row: T; isEditing: boolean; isSaving: boolean; @@ -36,7 +36,7 @@ export type RowActionContext = { saveEdit: () => Promise; }; -export type EditCellContext = { +export type EditCellContext = { row: T; column: ColumnProps; value: EditPrimitive; @@ -111,7 +111,7 @@ type TableProps = { className?: string; }; -const isVisible = ({ visible = true }: ColumnProps) => visible; +const isVisible = ({ visible = true }: ColumnProps) => visible; const hasValidationErrors = (errors?: EditErrors | null) => Boolean(errors && Object.values(errors).some(Boolean)); @@ -233,10 +233,13 @@ const Table = ({ return editable.getInitialDraft(row); } - return editableColumns.reduce((draft, column) => { - draft[column.dataIndex] = get(row, column.dataIndex) as EditPrimitive; - return draft; - }, {} as EditDraft); + return editableColumns.reduce>( + (draft, column) => { + draft[column.dataIndex] = get(row, column.dataIndex) as EditPrimitive; + return draft; + }, + {}, + ) as EditDraft; }; const getDraftForRow = (row: T): EditDraft => {