import { getNodeLabel } from '@ory/integrations/ui' ; import { UiNode , UiNodeInputAttributes } from '@ory/kratos-client' ; import { Button , Checkbox , TextInput } from '@ory/themes' ; import { FormDispatcher , NodeInputProps , ValueSetter } from './helpers' ; export function NodeInputButton < T > ( { node , attributes , setValue , disabled , dispatchSubmit } ) { const onClick = ( ) => { if ( attributes . onclick ) { const run = new Function ( attributes . onclick ) ; run ( ) ; } } ; return ( < > < Button name = { attributes . name } onClick = { ( e ) => { onClick ( ) ; setValue ( attributes . value ) . then ( ( ) => dispatchSubmit ( e ) ) ; } } value = { attributes . value || '' } disabled = { attributes . disabled || disabled } > { getNodeLabel ( node ) } < /Button> < />); }