import { type ButtonHTMLAttributes, type ReactNode } from 'react'; import type { Column } from '@tanstack/react-table'; import { type TestableProps } from '../../utils/testId'; export interface TableSortTriggerProps extends Omit, 'color' | 'type' | 'children'>, TestableProps { /** * Column from the header render context — wires the trigger to TanStack's * sort state. Pass `header.column` directly: * * ```tsx * header: ({ column }) => ( * * Name * * ) * ``` */ column: Column; /** Label rendered next to the sort icon. Visual styling matches the default header text. */ children?: ReactNode; } /** * Consumer-rendered sort trigger. Replaces the auto-rendered sort icon when * present as a direct child of the column's `header` render return — the * `TableHeadCell` children-scan suppresses the default `TableSortHandler` and * does not wrap the label in its own ``. * * All native button attributes (including `data-analytics-id`, * `data-analytics-props`, `aria-*`, `id`, `ref`, and any `data-*`) reach the * underlying `