import { observer } from '@formily/react'; import { Action, ActionBar, SchemaComponent, SchemaComponentProvider, SchemaInitializer } from '@nocobase/client'; import React from 'react'; const InitializerButton = observer((props: any) => { return ( schema} insertPosition={'beforeEnd'} style={{ marginLeft: 8 }} items={[ { title: 'Enable actions', children: [ { title: 'Create', key: 'create', component: 'ActionInitializer', schema: { 'x-align': 'left', }, }, { title: 'Update', key: 'update', component: 'ActionInitializer', }, ], }, ]} > Configure actions ); }); const ActionInitializer = (props) => { const { title, schema, insert } = props; return ( { insert({ type: 'void', title: info.key, 'x-component': 'Action', ...schema, }); }} > {title} ); }; export default function App() { return ( ); }