import clsx from "clsx"; import React from "react"; import { TypedField } from "../../../lib"; import { Button } from "../../button"; import { Outline } from "../../icon"; import { P } from "../../typography"; import { useDataGridContext } from "./datagridcontext"; export type DataGridHeadingCellProps< T extends object = object, // eslint-disable-next-line @typescript-eslint/no-unused-vars F extends object = T, > = React.PropsWithChildren<{ field: TypedField; }>; /** * DataGrid (heading) cell */ export const DataGridHeadingCell = < T extends object = object, F extends object = T, >({ children, field, }: DataGridHeadingCellProps) => { const { sortField, sortDirection, onSort } = useDataGridContext(); const isSorted = sortField === field.name; return ( {field.sortable ? ( ) : (

{children}

)} ); };