markdown: limit table cell preview

This commit is contained in:
Sidney Alcantara
2022-06-14 15:59:13 +10:00
parent 53e6d7b006
commit 94ed6e8611

View File

@@ -4,12 +4,17 @@ import { useTheme } from "@mui/material";
import MDEditor from "@uiw/react-md-editor";
export default function Code({ value }: IBasicCellProps) {
export default function Markdown({ value }: IBasicCellProps) {
const theme = useTheme();
if (!value || typeof value !== "string") return null;
return (
<div data-color-mode={theme.palette.mode}>
<MDEditor.Markdown source={value} />
<div
data-color-mode={theme.palette.mode}
style={{ height: "100%", overflow: "hidden", whiteSpace: "normal" }}
>
<MDEditor.Markdown source={value.slice(0, 240)} />
</div>
);
}