-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathApp.jsx
More file actions
48 lines (43 loc) · 940 Bytes
/
App.jsx
File metadata and controls
48 lines (43 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { Content } from '@builder.io/sdk-solid';
import { createMutable } from 'solid-js/store';
function MyFunComponent({ text }) {
const state = createMutable({
count: 0,
});
return (
<div>
<h3>{text.toUpperCase()}</h3>
<p>{state.count}</p>
<button onClick={() => state.count++}>Click me</button>
</div>
);
}
const CUSTOM_COMPONENTS = [
{
component: MyFunComponent,
name: 'MyFunComponent',
inputs: [
{
name: 'text',
type: 'string',
defaultValue: 'Hello world',
},
],
},
];
function App({ builderContent }) {
return (
<div>
<header class="text-center p-5">Hello world!</header>
<div>
<Content
content={builderContent}
model="page"
customComponents={CUSTOM_COMPONENTS}
apiKey={'f1a790f8c3204b3b8c5c1795aeac4660'}
/>
</div>
</div>
);
}
export default App;