mirror of
https://github.com/cssgunc/compass.git
synced 2025-04-20 10:30:16 -04:00
updated documentation
This commit is contained in:
parent
77f1bd803d
commit
4e79bae4b4
|
@ -14,7 +14,8 @@ type ResourceTableProps = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table componenet used for displaying resources
|
* 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 ) {
|
export default function ResourceTable({ data, setData }: ResourceTableProps ) {
|
||||||
const columnHelper = createColumnHelper<Resource>();
|
const columnHelper = createColumnHelper<Resource>();
|
||||||
|
|
|
@ -15,7 +15,8 @@ type ServiceTableProps = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table componenet used for displaying services
|
* 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 ) {
|
export default function ServiceTable({ data, setData }: ServiceTableProps ) {
|
||||||
const columnHelper = createColumnHelper<Service>();
|
const columnHelper = createColumnHelper<Service>();
|
||||||
|
|
|
@ -45,8 +45,8 @@ const fuzzyFilter = (
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General componenet that holds shared functionality for any data table component
|
* 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.data Stateful list of data to be held in the table
|
||||||
* @param props.setData State setter to be used for data manipulation methods
|
* @param props.setData State setter for the list of data
|
||||||
* @param props.columns Column definitions made with Tanstack columnHelper
|
* @param props.columns Column definitions made with Tanstack columnHelper
|
||||||
*/
|
*/
|
||||||
export default function Table<T extends DataPoint>({ data, setData, columns }: TableProps<T>) {
|
export default function Table<T extends DataPoint>({ data, setData, columns }: TableProps<T>) {
|
||||||
|
|
|
@ -14,7 +14,8 @@ type UserTableProps = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table componenet used for displaying users
|
* 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 ) {
|
export default function UserTable({ data, setData }: UserTableProps ) {
|
||||||
const columnHelper = createColumnHelper<User>();
|
const columnHelper = createColumnHelper<User>();
|
||||||
|
@ -25,16 +26,6 @@ export default function UserTable({ data, setData }: UserTableProps ) {
|
||||||
"employee",
|
"employee",
|
||||||
])
|
])
|
||||||
|
|
||||||
const handleRowUpdate = (updatedRow: User) => {
|
|
||||||
setData(prevData => (
|
|
||||||
prevData.map(row => (
|
|
||||||
row.id === updatedRow.id
|
|
||||||
? updatedRow
|
|
||||||
: row
|
|
||||||
))
|
|
||||||
))
|
|
||||||
};
|
|
||||||
|
|
||||||
const columns: ColumnDef<User, any>[] = [
|
const columns: ColumnDef<User, any>[] = [
|
||||||
columnHelper.accessor("username", {
|
columnHelper.accessor("username", {
|
||||||
header: () => (
|
header: () => (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user