mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
markdown: limit table cell preview
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user