MCPcopy Create free account
hub / github.com/AlexErrant/Pentive / ExamplePlugin

Function ExamplePlugin

example-plugins/solid/src/examplePlugin.tsx:8–39  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

6 setCount: Setter<number>
7 child: VoidComponent<{ count: number; setCount: Setter<number> }>
8}> = (props) => {
9 return (
10 <div
11 // medTODO not sure why `border-red-900` isn't working, figure out later when it's time to learn CSS. grep B4197330-831F-4CD8-84F1-0CF7AE2FA22F
12 style={{ 'border-color': 'red' }}
13 class='border rounded-lg p-1 m-1 border-red-900'
14 data-testid='plugin-count-component'
15 >
16 <h1>Example Solid Plugin</h1>
17 <button
18 class='border rounded-lg px-2 mx-2 border-red-900'
19 onClick={() => props.setCount(props.count - 0.1)}
20 >
21 -0.1
22 </button>
23 Count: <output>{props.count}</output>
24 {/* If the above isn't reactive, make sure `app` is running via `pnpm preview`
25 (`external` doesn't work in dev https://github.com/vitejs/vite/issues/6582 https://github.com/vitejs/vite/issues/2483) */}
26 <button
27 class='border rounded-lg px-2 mx-2 border-red-900'
28 onClick={() => props.setCount(props.count + 0.1)}
29 >
30 +0.1
31 </button>
32 <Dynamic
33 component={props.child}
34 count={props.count}
35 setCount={props.setCount}
36 />
37 </div>
38 )
39}
40
41export default ExamplePlugin

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected