From 618199a0adb83aef333c103db97ed231182d8dab Mon Sep 17 00:00:00 2001 From: Taras Haidar Date: Thu, 4 Apr 2024 09:42:16 +0300 Subject: [PATCH] Updated types --- src/components/data-grid/DataGrid.tsx | 2 +- src/components/data-grid/types.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/data-grid/DataGrid.tsx b/src/components/data-grid/DataGrid.tsx index 6ba80ae91..5c66ed7c0 100755 --- a/src/components/data-grid/DataGrid.tsx +++ b/src/components/data-grid/DataGrid.tsx @@ -441,7 +441,7 @@ export const DataGrid = ({ const rowDataCopy = rowData?.map((item) => { if (selectedGroupOption && item[selectedGroupOption.field] === EMPTY_GROUP) { - item[selectedGroupOption.field] = translations.emptyGroup[selectedGroupOption.field]; + item[selectedGroupOption?.field] = translations?.emptyGroup[selectedGroupOption?.field]; return item; } else { return item; diff --git a/src/components/data-grid/types.ts b/src/components/data-grid/types.ts index 6914600b3..a959ee3df 100755 --- a/src/components/data-grid/types.ts +++ b/src/components/data-grid/types.ts @@ -142,6 +142,10 @@ export interface FormatSettings { timeFormat?: string; } +interface EmptyGroup { + [key: string]: string; +} + export interface Translations { rowCountText: (count: number, totalCount: number) => JSX.Element; rowCountSelectedText: (count: number) => JSX.Element; @@ -187,7 +191,7 @@ export interface Translations { none: string; clearFilters: string; add: string; - emptyGroup: { teamName: string }; + emptyGroup: EmptyGroup; } export interface DataGridSetting {