Skip to content

Commit b9ca430

Browse files
committed
Update codeblock
1 parent 3621bc1 commit b9ca430

1 file changed

Lines changed: 4 additions & 23 deletions

File tree

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,9 @@
1-
import { ReactNode } from 'react';
1+
import { PropsWithChildren } from 'react';
22

3-
import { Sheet, SheetProps } from '@mui/joy';
4-
5-
interface ICodeblockProps extends SheetProps {
6-
children: ReactNode;
7-
}
8-
9-
export default function Codeblock({ children, ...props }: ICodeblockProps) {
3+
export default function Codeblock({ children, ...props }: PropsWithChildren) {
104
return (
11-
<Sheet
12-
variant="outlined"
13-
color="primary"
14-
component="pre"
15-
sx={{
16-
fontSize: 'sm',
17-
fontFamily: 'code',
18-
p: 1,
19-
m: 0,
20-
borderRadius: 'sm',
21-
backgroundColor: 'rgba(var(--joy-palette-primary-mainChannel) / .1)'
22-
}}
23-
{...props}
24-
>
5+
<pre className="rounded-sm border border-indigo-200 bg-indigo-100 px-2 py-1.5 font-mono text-sm text-indigo-600" {...props}>
256
<code>{children}</code>
26-
</Sheet>
7+
</pre>
278
);
289
}

0 commit comments

Comments
 (0)