diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx index d6af60e..0283a8d 100644 --- a/src/components/Table/Table.tsx +++ b/src/components/Table/Table.tsx @@ -15,12 +15,11 @@ export type TableColumns = OmitExtends, ColumnSettin export type TableContainer = TableProps & { columns: TableColumns dataSource: any[] - children?: ReactNode tableName?: string - hideSettingsChanger?: boolean + showSettingsChanger?: boolean } -export const Table = memo(({ columns, dataSource, children, tableName, hideSettingsChanger, ...other }) => { +export const Table = memo(({ columns, dataSource, tableName, showSettingsChanger, ...other }) => { const [newColumns, setNewColumns] = useState([]) const [settings, setSettings] = useState({}) @@ -33,7 +32,7 @@ export const Table = memo(({ columns, dataSource, children, tabl useEffect(() => setSettings(tableName ? getTableSettings(tableName) : {}), [tableName]) useEffect(() => setNewColumns(() => { const newColumns = applySettings(columns, settings) - if (tableName && !hideSettingsChanger) { + if (tableName && showSettingsChanger) { const oldTitle = newColumns[0].title newColumns[0].title = (props) => (
@@ -45,14 +44,13 @@ export const Table = memo(({ columns, dataSource, children, tabl ) } return newColumns - }), [settings, columns, onSettingsChanged, hideSettingsChanger, tableName]) + }), [settings, columns, onSettingsChanged, showSettingsChanger, tableName]) return ( ) })