new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

shadcn/ui · Components · all subjects

data-table/composition

3 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Basic DataTable component structure

The DataTable component accepts columns (ColumnDef array) and data (TData array) as props. Call useTable with features, data, and columns. Use table.getHeaderGroups() to render headers and table.getRowModel().rows to render table rows. Use table.FlexRender for rendering headers and cells. If no rows, display a message spanning all columns with colSpan={columns.length}.

Reusable DataTable component extraction

If using the same data table in multiple places, extract the DataTable component to a reusable location like components/ui/data-table.tsx and import it as <DataTable columns={columns} data={data} />.

Payment data type example

Example Payment type structure: type Payment = { id: string; amount: number; status: 'pending' | 'processing' | 'success' | 'failed'; email: string }

Give your agent this brain