From aa239cf2f16aef7fcbca4dd05f8d76de8fbf68df Mon Sep 17 00:00:00 2001 From: nidhigarg-bmw Date: Mon, 29 Apr 2024 10:20:48 +0530 Subject: [PATCH] feat(table): fix code smell error --- .../Table/components/Toolbar/SearchAndFilterButtonToolbar.tsx | 4 ++-- .../basic/Table/components/Toolbar/SortImage/index.tsx | 2 +- src/components/basic/Table/index.tsx | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/basic/Table/components/Toolbar/SearchAndFilterButtonToolbar.tsx b/src/components/basic/Table/components/Toolbar/SearchAndFilterButtonToolbar.tsx index 0c5ab8d6..307c3983 100644 --- a/src/components/basic/Table/components/Toolbar/SearchAndFilterButtonToolbar.tsx +++ b/src/components/basic/Table/components/Toolbar/SearchAndFilterButtonToolbar.tsx @@ -27,7 +27,7 @@ import { ViewSelector } from '../../../ViewSelector' import type { View } from '../../../ViewSelector' import { Typography } from '../../../Typography' import type { SelectedFilter } from './UltimateToolbar' -import { SortOption } from '../../../SortOption' +import { SortOption, type SortOptionsType } from '../../../SortOption' import SortImage from './SortImage' export interface SearchAndFilterButtonToolbarProps extends ToolbarProps { @@ -38,7 +38,7 @@ export interface SearchAndFilterButtonToolbarProps extends ToolbarProps { defaultFilter?: string onFilter?: (selectedFilter: SelectedFilter) => void defaultSortOption?: string - sortOptions?: { label: string, value: string }[] + sortOptions?: SortOptionsType[] onSortClick?: (value: string) => void descriptionText?: string autoFocus?: boolean diff --git a/src/components/basic/Table/components/Toolbar/SortImage/index.tsx b/src/components/basic/Table/components/Toolbar/SortImage/index.tsx index 83ed2846..8efa8ca4 100644 --- a/src/components/basic/Table/components/Toolbar/SortImage/index.tsx +++ b/src/components/basic/Table/components/Toolbar/SortImage/index.tsx @@ -26,7 +26,7 @@ interface SortIconProps { selected?: boolean } -export default function SortImage({ onClick, selected }: SortIconProps) { +export default function SortImage({ onClick, selected }: Readonly) { return ( void alignCell?: string error?: {