import styles from "./table-header.module.scss"; import React from "react"; import type { Table } from "@tanstack/react-table"; import { flexRender } from '@tanstack/react-table'; import { cssNames } from "../../utils"; interface TableHeaderProps { table: Table; } export function TableHeader({ table }: TableHeaderProps) { return ( {table.getHeaderGroups().map(headerGroup => ( {headerGroup.headers.map(header => ( {header.isPlaceholder ? null : (
{flexRender( header.column.columnDef.header, header.getContext() )} {{ asc: ' 🔼', desc: ' 🔽', }[header.column.getIsSorted() as string] ?? null} {header.column.getCanResize() && (
)}
)} ))} ))} ) }