import React from 'react';
import { Handle, Position } from 'reactflow';
import {
FaKeyboard,
FaRobot,
FaLightbulb,
FaBell,
FaYoutube,
FaBrain,
FaMicrophone,
FaSlidersH,
FaSearch,
FaBookReader
} from 'react-icons/fa';
import { BiPodcast } from 'react-icons/bi';
import './CustomNodes.css';
const nodeIcons = {
input: FaKeyboard,
researcher: FaSearch,
agent: FaRobot,
insights: FaBrain,
notify: FaBell,
publish: FaYoutube,
default: BiPodcast
};
// Base node component
const BaseNode = ({ data, nodeType, icon: IconComponent, color, showSourceHandle = true, showTargetHandle = true }) => {
// Use CSS variable through inline style object without TypeScript complaints
const nodeStyle = {
borderColor: color,
// Additional inline styles can be added here
};
// Check if this is an input node with a prompt
const hasPrompt = nodeType === 'input-node' && data.prompt;
return (
{showTargetHandle && (
)}
{data.description && (
{data.description}
)}
{data.prompt && nodeType === 'input-node' && (
)}
{showSourceHandle && (
)}
);
};
// Specific node types
export const InputNode = (props) => {
// Input nodes only have source handles (output)
return (
);
};
// Specialized Researcher node (a type of agent)
export const ResearcherNode = (props) => {
return (
);
};
export const AgentNode = (props) => {
return (
);
};
export const InsightsNode = (props) => {
return (
);
};
export const NotifyNode = (props) => {
return (
);
};
export const PublishNode = (props) => {
// Output nodes only have target handles (input)
return (
);
};
// Default node for any other types
export const DefaultNode = (props) => {
return (
);
};
// A map of node types to their components for easy registration
export const nodeTypes = {
input: InputNode,
researcher: ResearcherNode,
agent: AgentNode,
insights: InsightsNode,
notify: NotifyNode,
output: PublishNode,
default: DefaultNode
};
export default nodeTypes;