MCPcopy
hub / github.com/027xiguapi/code-box / CssCode

Function CssCode

component/items/cssCode.tsx:7–39  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

5import { i18n } from "~tools"
6
7export default function CssCode(props) {
8 let { name } = props
9
10 const [runCss, setRunCss] = useStorage(`${name}-runCss`, (v) =>
11 v === undefined ? false : v
12 )
13 const [cssCode, setCssCode, { setRenderValue, setStoreValue, remove }] =
14 useStorage(`${name}-cssCode`)
15
16 return (
17 <>
18 <div className="item">
19 <span>{i18n("customCssCode")}</span>
20 <input
21 type="checkbox"
22 id={`${name}-runCss`}
23 name={`${name}-runCss`}
24 className="codebox-offscreen"
25 checked={runCss}
26 onChange={(e) => setRunCss(e.target.checked)}
27 />
28 <label className="codebox-switch" htmlFor={`${name}-runCss`}></label>
29 </div>
30 <div className={`item ${runCss ? "" : "hide"}`}>
31 <Input.TextArea
32 name={`${name}-cssCode`}
33 value={cssCode}
34 onChange={(e) => setRenderValue(e.target.value)}
35 onBlur={(e) => setStoreValue()}></Input.TextArea>
36 </div>
37 </>
38 )
39}

Callers

nothing calls this directly

Calls 1

i18nFunction · 0.85

Tested by

no test coverage detected