mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
chore: use new table design for markdown rendering (#17530)
resolves #17502 <img width="756" alt="Screenshot 2025-04-23 at 11 26 19" src="https://github.com/user-attachments/assets/667c595c-21de-496c-8f25-3dca9f840c7c" />
This commit is contained in:
@ -1,11 +1,12 @@
|
|||||||
import type { Interpolation, Theme } from "@emotion/react";
|
import type { Interpolation, Theme } from "@emotion/react";
|
||||||
import Link from "@mui/material/Link";
|
import Link from "@mui/material/Link";
|
||||||
import Table from "@mui/material/Table";
|
import {
|
||||||
import TableBody from "@mui/material/TableBody";
|
Table,
|
||||||
import TableCell from "@mui/material/TableCell";
|
TableBody,
|
||||||
import TableContainer from "@mui/material/TableContainer";
|
TableCell,
|
||||||
import TableHead from "@mui/material/TableHead";
|
TableHeader,
|
||||||
import TableRow from "@mui/material/TableRow";
|
TableRow,
|
||||||
|
} from "components/Table/Table";
|
||||||
import isEqual from "lodash/isEqual";
|
import isEqual from "lodash/isEqual";
|
||||||
import { type FC, memo } from "react";
|
import { type FC, memo } from "react";
|
||||||
import ReactMarkdown, { type Options } from "react-markdown";
|
import ReactMarkdown, { type Options } from "react-markdown";
|
||||||
@ -90,11 +91,7 @@ export const Markdown: FC<MarkdownProps> = (props) => {
|
|||||||
},
|
},
|
||||||
|
|
||||||
table: ({ children }) => {
|
table: ({ children }) => {
|
||||||
return (
|
return <Table>{children}</Table>;
|
||||||
<TableContainer>
|
|
||||||
<Table>{children}</Table>
|
|
||||||
</TableContainer>
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
tr: ({ children }) => {
|
tr: ({ children }) => {
|
||||||
@ -102,7 +99,7 @@ export const Markdown: FC<MarkdownProps> = (props) => {
|
|||||||
},
|
},
|
||||||
|
|
||||||
thead: ({ children }) => {
|
thead: ({ children }) => {
|
||||||
return <TableHead>{children}</TableHead>;
|
return <TableHeader>{children}</TableHeader>;
|
||||||
},
|
},
|
||||||
|
|
||||||
tbody: ({ children }) => {
|
tbody: ({ children }) => {
|
||||||
|
Reference in New Issue
Block a user