diff --git a/compass/components/Table/ResourceTable.tsx b/compass/components/Table/ResourceTable.tsx index 172f6d0..fa69b15 100644 --- a/compass/components/Table/ResourceTable.tsx +++ b/compass/components/Table/ResourceTable.tsx @@ -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(); diff --git a/compass/components/Table/ServiceTable.tsx b/compass/components/Table/ServiceTable.tsx index f029fca..0904e08 100644 --- a/compass/components/Table/ServiceTable.tsx +++ b/compass/components/Table/ServiceTable.tsx @@ -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(); diff --git a/compass/components/Table/Table.tsx b/compass/components/Table/Table.tsx index a1f469c..a84b462 100644 --- a/compass/components/Table/Table.tsx +++ b/compass/components/Table/Table.tsx @@ -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({ data, setData, columns }: TableProps) { diff --git a/compass/components/Table/UserTable.tsx b/compass/components/Table/UserTable.tsx index 20f0ca3..7cdf131 100644 --- a/compass/components/Table/UserTable.tsx +++ b/compass/components/Table/UserTable.tsx @@ -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(); @@ -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[] = [ columnHelper.accessor("username", { header: () => (