Skip to content

Commit

Permalink
rewrote EnhancedTableHeaderCell to tsx format (#2156)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Popovych authored Jul 29, 2024
1 parent ae46d84 commit 509d3a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@ import TableCell from '@mui/material/TableCell'
import TableSortLabel from '@mui/material/TableSortLabel'

import { styles } from '~/components/enhanced-table/enhanced-table-header-cell/EnhancedTableHeaderCell.styles'
import { TableColumn, TableItem, TableSort } from '~/types'

const EnhancedTableHeaderCell = ({ column, sort }) => {
export interface EnhancedTableHeaderCellProps<I> {
column: TableColumn<I>
sort: TableSort
}

const EnhancedTableHeaderCell = <I extends TableItem>({
column,
sort
}: EnhancedTableHeaderCellProps<I>) => {
const { t } = useTranslation()
const { sort: sortParams, onRequestSort } = sort

const createSortHandler = () => {
onRequestSort(column.field)
onRequestSort(column.field ?? '')
}

return (
Expand Down

0 comments on commit 509d3a5

Please sign in to comment.