import React, { FC } from 'react'; import TableSortLabel from '@mui/material/TableSortLabel'; import Tooltip from '@mui/material/Tooltip'; import { MRT_Header, MRT_TableInstance } from '..'; import type { TableCellProps } from '@mui/material/TableCell'; interface Props { header: MRT_Header; table: MRT_TableInstance; tableCellProps?: TableCellProps; } export const MRT_TableHeadCellSortLabel: FC = ({ header, table, tableCellProps, }) => { const { options: { icons: { ArrowDownwardIcon }, localization, }, } = table; const { column } = header; const { columnDef } = column; const sortTooltip = column.getIsSorted() ? column.getIsSorted() === 'desc' ? localization.sortedByColumnDesc.replace('{column}', columnDef.header) : localization.sortedByColumnAsc.replace('{column}', columnDef.header) : localization.unsorted; return ( ); };