can now pass the function that gives subtitle as well
This commit is contained in:
parent
d66dc68495
commit
3d8cfc5125
2 changed files with 4 additions and 3 deletions
|
|
@ -71,7 +71,7 @@ interface Props<T> {
|
|||
rows: T[],
|
||||
columns?: Column<T>[] | (() => Column<T>[]),
|
||||
title?: string | JSX.Element;
|
||||
subtitle?: string | JSX.Element;
|
||||
subtitle?: string | JSX.Element | (() => string | JSX.Element);
|
||||
total: number,
|
||||
pageSize: number,
|
||||
page: number,
|
||||
|
|
@ -98,7 +98,7 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
setPage,
|
||||
handleRowsPerPageChange,
|
||||
title,
|
||||
subtitle,
|
||||
// subtitle,
|
||||
renderGutter,
|
||||
setSearchText,
|
||||
isLoading,
|
||||
|
|
@ -113,6 +113,7 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
|
|||
} = props
|
||||
const classes = useStyles();
|
||||
const columns = typeof(props.columns) === "function" ? props.columns() : props.columns
|
||||
const subtitle = typeof(props.subtitle) === "function" ? props.subtitle() : props.subtitle
|
||||
|
||||
const isMobile = useMobile()
|
||||
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ export default function Devices() {
|
|||
<DevicesSummary setSearch={setSearch} />
|
||||
<ResponsiveTable<Device>
|
||||
title={<SmartBreadcrumb prependPaths={getGroup() && ["groups", getGroup().id().toString()]} groupName={getGroup() && getGroup().name()} paddingBottom={1}/>}
|
||||
subtitle={subtitle()}
|
||||
subtitle={subtitle}
|
||||
rows={devices}
|
||||
renderGutter={ isMobile ? gutter : undefined }
|
||||
columns={columns}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue