mirror of
https://github.com/cssgunc/compass.git
synced 2025-04-09 14:00:15 -04:00
updated documentation
This commit is contained in:
parent
2bf3df68f8
commit
9de2684688
|
@ -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>();
|
||||
|
|
|
@ -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>();
|
||||
|
|
|
@ -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>) {
|
||||
|
|
|
@ -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: () => (
|
||||
|
|
Loading…
Reference in New Issue
Block a user