build ok,

This commit is contained in:
louiscklaw
2025-04-14 10:45:50 +08:00
parent 59899fafc4
commit 4392f1eeac

View File

@@ -8,6 +8,7 @@ import TableBody from '@mui/material/TableBody';
import TableCell from '@mui/material/TableCell';
import TableHead from '@mui/material/TableHead';
import TableRow from '@mui/material/TableRow';
import { useTranslation } from 'react-i18next';
export interface ColumnDef<TRowModel> {
align?: 'left' | 'right' | 'center';
@@ -52,6 +53,7 @@ export function DataTable<TRowModel extends object & { id?: RowId | null }>({
}: DataTableProps<TRowModel>): React.JSX.Element {
const selectedSome = (selected?.size ?? 0) > 0 && (selected?.size ?? 0) < rows.length;
const selectedAll = rows.length > 0 && selected?.size === rows.length;
const { t } = useTranslation();
return (
<Table {...props}>
@@ -83,7 +85,7 @@ export function DataTable<TRowModel extends object & { id?: RowId | null }>({
...(column.align && { textAlign: column.align }),
}}
>
{column.hideName ? null : column.name}
{column.hideName ? null : t(column.name)}
</TableCell>
)
)}