Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

580 B
Raw Blame
import { useEffect, useState } from 'react';
import { plugins, PluginTarget, PluginType } from './Plugins';


export const PluginComponents = ({targetId}: {targetId: PluginTarget}) => {
const [components, setComponents] = useState<React.ReactNode[]>([]);

useEffect(() => {
    const matchedPlugins = plugins.getPluginsByTarget(targetId, PluginType.Component) as {component: React.ReactNode}[];
    setComponents(matchedPlugins.map((plugin) => plugin.component));
}, [targetId]);

  
  
  return <>{components.map((component, index) => <div key={index}>{component}</div>)}</>;
};