Skip to content

Commit

Permalink
rewrote EnhancedTableHeaderCell to tsx format
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Popovych committed Jul 23, 2024
1 parent 8d4075c commit 9c9fd59
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 9c9fd59

Please sign in to comment.