diff --git a/src/components/table/table_header_cell.tsx b/src/components/table/table_header_cell.tsx index f506b301554..9ddb2694118 100644 --- a/src/components/table/table_header_cell.tsx +++ b/src/components/table/table_header_cell.tsx @@ -17,6 +17,7 @@ import { RIGHT_ALIGNMENT, CENTER_ALIGNMENT, } from '../../services'; +import { EuiI18n } from '../i18n'; export type TableHeaderCellScope = 'col' | 'row' | 'colgroup' | 'rowgroup'; @@ -106,14 +107,29 @@ export const EuiTableHeaderCell: FunctionComponent = ({ function getScreenCasterDirection() { if (ariaSortValue === 'ascending') { - return 'Click to sort in descending order'; + return ( + + ); } if (allowNeutralSort && ariaSortValue === 'descending') { - return 'Click to unsort'; + return ( + + ); } - return 'Click to sort in ascending order'; + return ( + + ); } return ( @@ -133,26 +149,36 @@ export const EuiTableHeaderCell: FunctionComponent = ({ {(ref, innerText) => ( - - {children} - + + {(titleTextWithSort: string) => ( + + {children} + + )} + )} {isSorted && ( - + + {(sortedAriaLabel: string) => ( + + )} + )} {getScreenCasterDirection()}