Refactor ErrorsGridView component to streamline imports and enhance filtering functionality. Update pagination handling and integrate new log columns for improved data presentation. Adjust related components for consistency and performance optimization.
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
'use no memo'
|
||||
|
||||
import { type ColumnDef } from '@tanstack/react-table'
|
||||
|
||||
import { DataGridColumnHeader } from '@/components/reui/data-grid/data-grid-column-header'
|
||||
|
||||
export interface ClientRow {
|
||||
id: string
|
||||
username: string
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Managed clients columns.
|
||||
* Preview: https://reui.io/preview/base/data-grid-base-1
|
||||
* Docs: https://reui.io/docs/components/base/data-grid
|
||||
*/
|
||||
export function createClientsColumns(): ColumnDef<ClientRow, unknown>[] {
|
||||
return [
|
||||
{
|
||||
id: 'username',
|
||||
accessorKey: 'username',
|
||||
header: ({ column }) => (
|
||||
<DataGridColumnHeader title="Username" visibility={true} column={column} />
|
||||
),
|
||||
cell: ({ row }) => (
|
||||
<span className="font-medium">{row.original.username}</span>
|
||||
),
|
||||
enableSorting: true,
|
||||
size: 200,
|
||||
},
|
||||
{
|
||||
id: 'createdAt',
|
||||
accessorKey: 'createdAt',
|
||||
header: ({ column }) => (
|
||||
<DataGridColumnHeader title="Created" visibility={true} column={column} />
|
||||
),
|
||||
cell: ({ row }) => (
|
||||
<span className="text-muted-foreground text-xs tabular-nums">
|
||||
{row.original.createdAt}
|
||||
</span>
|
||||
),
|
||||
enableSorting: true,
|
||||
size: 200,
|
||||
},
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user