refactor and create type for functions and majority of variables
This commit is contained in:
parent
e14debfcc0
commit
9d55bcd751
50 changed files with 302 additions and 1022 deletions
|
|
@ -5,15 +5,16 @@ import { isValidConnection, nodeColors, snakeToNormalCase } from "../../utils";
|
|||
import Tooltip from "../../components/TooltipComponent";
|
||||
import { useContext } from "react";
|
||||
import { typesContext } from "../../contexts/typesContext";
|
||||
import { NodeDataType } from "../../types/flow";
|
||||
|
||||
export default function ChatOutputNode({ data }) {
|
||||
const {types} = useContext(typesContext);
|
||||
export default function ChatOutputNode({ data }:{data:NodeDataType}) {
|
||||
const {types,reactFlowInstance} = useContext(typesContext);
|
||||
return (
|
||||
<div className="prompt-node relative rounded-lg solid border flex justify-center align-center py-3 px-6 bg-gray-50" style={{color: nodeColors[types[data.type]]}}>
|
||||
<Tooltip title="Message: str">
|
||||
<Handle
|
||||
type="target"
|
||||
isValidConnection={(connection) => isValidConnection(data,connection)}
|
||||
isValidConnection={(connection) => isValidConnection(connection,reactFlowInstance)}
|
||||
position={Position.Left}
|
||||
id={"str|output|"+data.id}
|
||||
className={"-ml-0.5 w-3 h-3 rounded-full border-2 bg-white"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue