mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Merge branch 'main' into chore/project4-iteration24-652-speciestab-typing
This commit is contained in:
@@ -8,25 +8,29 @@ export const SimpleTable = <T extends MRT_RowData, ParentType extends MRT_RowDat
|
||||
columns,
|
||||
idFieldName,
|
||||
url,
|
||||
isFetching,
|
||||
}: {
|
||||
data?: Array<T> | null
|
||||
columns: MRT_ColumnDef<T>[]
|
||||
idFieldName?: keyof T
|
||||
url?: string
|
||||
isFetching?: boolean
|
||||
}) => {
|
||||
const { mode } = useDetailContext<ParentType>()
|
||||
|
||||
if (!data) return <CircularProgress />
|
||||
if (isFetching) return <CircularProgress />
|
||||
|
||||
const safeData = data ?? []
|
||||
|
||||
if (!idFieldName) {
|
||||
return <DetailTabTable<T> mode="edit" data={data} columns={columns} enableRowActions={false} />
|
||||
return <DetailTabTable<T> mode="edit" data={safeData} columns={columns} enableRowActions={false} />
|
||||
}
|
||||
|
||||
return (
|
||||
<DetailTabTable<T>
|
||||
mode={mode.read ? 'read' : 'select'}
|
||||
title="Detail List"
|
||||
data={data}
|
||||
data={safeData}
|
||||
columns={columns}
|
||||
idFieldName={idFieldName}
|
||||
url={url}
|
||||
|
||||
@@ -62,7 +62,7 @@ export const TableToolBar = <T extends MRT_RowData>({
|
||||
)}
|
||||
<Box className="icon-buttons">
|
||||
<MRT_ShowHideColumnsButton table={table} />
|
||||
<Tooltip title="Export">
|
||||
<Tooltip title="Export table (hide columns to exclude them)">
|
||||
<IconButton
|
||||
id="export-button"
|
||||
aria-controls={open ? 'export-menu' : undefined}
|
||||
|
||||
Reference in New Issue
Block a user