File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,9 +56,10 @@ function escapeHtml(str: string) {
5656interface Props {
5757 code : string ;
5858 lang ?: string ;
59+ className ?: string ;
5960}
6061
61- export default function CodeBlock ( { code, lang = "java" } : Props ) {
62+ export default function CodeBlock ( { code, lang = "java" , className = "" } : Props ) {
6263 const theme = useTheme ( ) ;
6364 const themeName = theme === "dark" ? "github-dark" : "github-light" ;
6465 const [ html , setHtml ] = useState < string > ( "" ) ;
@@ -79,6 +80,6 @@ export default function CodeBlock({ code, lang = "java" }: Props) {
7980 } , [ code , lang , themeName ] ) ;
8081
8182 return (
82- < div className = " bg-card *:bg-transparent! rounded-lg p-4 border border-border overflow-x-auto my-6" dangerouslySetInnerHTML = { { __html : html } } />
83+ < div className = { ` bg-card *:bg-transparent! rounded-lg p-4 border border-border overflow-x-auto my-6 ${ className } ` } dangerouslySetInnerHTML = { { __html : html } } />
8384 ) ;
8485}
You can’t perform that action at this time.
0 commit comments