MCPcopy Create free account
hub / github.com/borabaloglu/9ui / ThemeCode

Function ThemeCode

apps/www/src/components/theme-code.tsx:13–49  ·  view source on GitHub ↗
({ css }: ThemeCodeProps)

Source from the content-addressed store, hash-verified

11}
12
13export const ThemeCode = ({ css }: ThemeCodeProps) => {
14 const prettyCode = React.useMemo(() => {
15 return highlighter.codeToHtml(css, {
16 lang: "css",
17 themes: {
18 dark: "github-dark-default",
19 light: "github-light-default",
20 },
21 transformers: [
22 {
23 pre(node) {
24 node.properties.style = "tab-size: 2"
25 },
26 code(node) {
27 node.properties.style = "tab-size: 2"
28 },
29 },
30 ],
31 })
32 }, [css])
33
34 return (
35 <div className="w-full overflow-hidden rounded-md border">
36 <CodeBar
37 label="globals.css"
38 className="border-t-0"
39 content={css}
40 type="other"
41 />
42
43 <div
44 className="max-h-[600px] overflow-auto p-4 text-sm"
45 dangerouslySetInnerHTML={{ __html: prettyCode }}
46 />
47 </div>
48 )
49}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected