@stakefish/ui
Version:
<div align="center"> <a href="https://www.npmjs.com/package/@stakefish/ui"><img src="https://gateway.pinata.cloud/ipfs/QmbZL1ceA8Yiz2pKALTg919jYx141DPUGegC9L4XpyayW5" width="300" /></a> </div>
39 lines (38 loc) • 1.3 kB
TypeScript
import React from "react";
import { TableContainerProps as MuiTableContainerProps } from "@mui/material/TableContainer";
import { TableCellProps as MuiTableCellProps } from "@mui/material/TableCell";
import { HeadCell } from "./TableHeadSort";
/**
* Utilities
*/
export declare function createCellData(dataSets: CellDataContent[], cellDataKeys: Array<keyof CellData>): CellData;
export declare function formatCellDataRowsIntoArray(data: CellData): CellDataContent[];
/**
* Types
*/
export declare type Order = "asc" | "desc";
export declare type CellDataKeys = keyof CellData;
export interface CellDataContent {
/**
* The actual content to be rendered
*/
content: string | number | JSX.Element | JSX.Element[] | React.ReactNode;
/**
* Additional props to decorate tableCell
*/
props?: {
[key in keyof MuiTableCellProps]: any;
};
}
export interface CellData {
/**
* The id of the cell to be synced with HeadCell at the same column
*/
[cellKey: string]: CellDataContent;
}
export interface TableContainerProps extends MuiTableContainerProps {
headCells: HeadCell[];
bodyCellsRows: CellData[];
}
declare const TableContainer: React.FC<TableContainerProps>;
export default TableContainer;