(formProps: P, value: FormStateProps[P]) { + setPlugin({ ...plugin, [formProps]: value }) + } + + // function handleSubmit (e) { + // console.log('Logging the form submit event', e) + // console.log('state of the plugin', plugin) + // } + + // const onValueChange = (event: any) => { + // const value = event.target.type === 'radio' ? event.target.checked : event.target.value + // const name = event.target.name + // if (name === 'name') { + // setName(value) + // } else if (name === 'displayName') { + // setDisplayName(value) + // } else if (name === 'methods') { + // setMethods(value) + // } else if (name === 'url') { + // setUrl(value) + // } else if (name === 'type') { + // setType(value) + // } else if (name === 'location') { + // setLocation(value) + // } + // } + return ( +
+ ) +} + +export default LocalPluginForm diff --git a/libs/remix-ui/plugin-manager/src/lib/components/pluginCard.tsx b/libs/remix-ui/plugin-manager/src/lib/components/pluginCard.tsx index 491ab46689..e17ea7b594 100644 --- a/libs/remix-ui/plugin-manager/src/lib/components/pluginCard.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/components/pluginCard.tsx @@ -1,9 +1,10 @@ import React, { useContext, useState } from 'react' +import { Profile } from '../../types' import { PluginManagerContext } from '../contexts/pluginmanagercontext' import '../remix-ui-plugin-manager.css' import Button from './button' interface PluginCardProps { - profile: any + profile: Partial