mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-22 22:35:45 +00:00
refactor(FE-Storyless): add footer rendering support to Table component
This commit is contained in:
@@ -75,6 +75,8 @@ export interface TableProps<TData extends object> {
|
|||||||
column: Column<TData, unknown>,
|
column: Column<TData, unknown>,
|
||||||
headerGroup: HeaderGroup<TData>
|
headerGroup: HeaderGroup<TData>
|
||||||
) => ReactNode;
|
) => ReactNode;
|
||||||
|
renderFooter?: boolean;
|
||||||
|
footerContent?: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DUMMY_SKELETON_DATA = [{}, {}, {}, {}, {}];
|
const DUMMY_SKELETON_DATA = [{}, {}, {}, {}, {}];
|
||||||
@@ -121,6 +123,8 @@ const Table = <TData extends object>({
|
|||||||
customHeaderRows = [],
|
customHeaderRows = [],
|
||||||
renderCustomHeaders = false,
|
renderCustomHeaders = false,
|
||||||
onCustomHeaderCellRender,
|
onCustomHeaderCellRender,
|
||||||
|
renderFooter = false,
|
||||||
|
footerContent,
|
||||||
}: TableProps<TData>) => {
|
}: TableProps<TData>) => {
|
||||||
const isServerSideTable =
|
const isServerSideTable =
|
||||||
totalItems !== undefined &&
|
totalItems !== undefined &&
|
||||||
@@ -327,6 +331,8 @@ const Table = <TData extends object>({
|
|||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
|
{renderFooter && footerContent}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user