updated documentation

This commit is contained in:
Nick A 2024-10-29 13:13:38 -04:00
parent 2bf3df68f8
commit 9de2684688
4 changed files with 8 additions and 15 deletions

View File

@ -14,7 +14,8 @@ type ResourceTableProps = {
/**
* Table componenet used for displaying resources
* @param props.resources List of resources to be displayed by the table
* @param props.data Stateful list of resources to be displayed by the table
* @param props.setData State setter for the list of resources
*/
export default function ResourceTable({ data, setData }: ResourceTableProps ) {
const columnHelper = createColumnHelper<Resource>();

View File

@ -15,7 +15,8 @@ type ServiceTableProps = {
/**
* Table componenet used for displaying services
* @param props.services List of services to be displayed by the table
* @param props.data Stateful list of services to be displayed by the table
* @param props.setData State setter for the list of services
*/
export default function ServiceTable({ data, setData }: ServiceTableProps ) {
const columnHelper = createColumnHelper<Service>();

View File

@ -45,8 +45,8 @@ const fuzzyFilter = (
/**
* General componenet that holds shared functionality for any data table component
* @param props.data List of data, managed through state, to be held in the table
* @param props.setData State setter to be used for data manipulation methods
* @param props.data Stateful list of data to be held in the table
* @param props.setData State setter for the list of data
* @param props.columns Column definitions made with Tanstack columnHelper
*/
export default function Table<T extends DataPoint>({ data, setData, columns }: TableProps<T>) {

View File

@ -14,7 +14,8 @@ type UserTableProps = {
/**
* Table componenet used for displaying users
* @param props.users List of users to be displayed by the table
* @param props.data Stateful list of users to be displayed by the table
* @param props.setData State setter for the list of users
*/
export default function UserTable({ data, setData }: UserTableProps ) {
const columnHelper = createColumnHelper<User>();
@ -25,16 +26,6 @@ export default function UserTable({ data, setData }: UserTableProps ) {
"employee",
])
const handleRowUpdate = (updatedRow: User) => {
setData(prevData => (
prevData.map(row => (
row.id === updatedRow.id
? updatedRow
: row
))
))
};
const columns: ColumnDef<User, any>[] = [
columnHelper.accessor("username", {
header: () => (