import React from 'react' import JavascriptDisplay from '../JavascriptDisplay/JavascriptDisplay' export const TableDocs = ({ tableName, children, }: { tableName: string children?: React.ReactNode }): React.JSX.Element => { return (
{tableName} is a component that allows you to display data
in a table format. It is a wrapper around the{' '}
react-sticky-table
{' '}
library.
{tableName}:
data for the column. We can get this from the{' '}
children function. The argument that is passed back will
be the data object for that column. You can get access to
that by doing this:
data object to get that value. Then we must use that to
properly style the data that we are trying to display. Here is an
example:
font-semibold class name
when it is actively being sorted on. We need the sortProp{' '}
from our data object to accomplish this. If we neglect
this, then the UI will be broken. So it is very important to remember
this while defining the JSX for each column.
mainColumn: true in the configuration for that column.
This is necessary for proper table styling.
hasButton: true in the configuration for that column.
This is necessary for proper table styling.