import type { ReactNode } from "react"; import type { SortDirection } from "../hooks/useSortable"; export default function SortableTh({ label, sortKeyName, activeKey, direction, onSort, className, }: { label: ReactNode; sortKeyName: keyof T; activeKey: keyof T | undefined; direction: SortDirection; onSort: (key: keyof T) => void; className?: string; }) { const active = activeKey === sortKeyName; return ( onSort(sortKeyName)} > {label} {active ? (direction === "asc" ? "▲" : "▼") : "↕"} ); }