У меня есть табличный компонент, который я написал его с использованием MUI. Я хочу изменить высоту таблеток, но я не могу найти способ сделать это. Я пробовал разные способы, но не могу найти решение. Вот мой компонент: < /p>
import React, { memo } from "react";
import {
ActionItemType,
ActionsType,
TableHeadItemType,
} from "./table-head.interface";
import {
IconButton,
TableCell,
TableRow as MuiTableRow,
Tooltip,
} from "@mui/material";
import { NavLink } from "react-router-dom";
interface ActionItemProps {
action: ActionItemType;
row: { [key: string]: any };
}
const ActionItem: React.FC = memo(({ action, row }) => {
return action?.onClick ? (
(action?.onClick ? action.onClick(row) : null)}
>
{action.icon}
) : action?.href ? (
{action.icon}
) : null;
});
interface ItemProps {
head: TableHeadItemType[];
row: { [key: string]: any };
actions?: ActionsType;
}
const TableRow: React.FC = ({ row, head, actions }) => (
{head.map((th) => (
{th.render
? th.render(row[th.id.toString()], row)
: row[th.id.toString()]}
))}
{actions && actions.length > 0 && (
{actions.map((action) => (
))}
)}
);
interface Props {
rows: { [key: string]: any };
head: TableHeadItemType[];
actions?: ActionsType;
}
const TableRows: React.FC
= ({ actions, head, rows }) => (
{rows.map((row: any) => (
))}
);
export default TableRows;
< /code>
Вот мой код. Я попытался добавить высоту в MuitableRow, например, sx = {{height: "10px"}}, а также я попытался добавить высоту в таблицы, но оба пути не работали.
Подробнее здесь: https://stackoverflow.com/questions/772 ... row-in-mui