Types made as a context
This commit is contained in:
parent
549ccdf658
commit
a7bd874e16
4 changed files with 139 additions and 93 deletions
|
|
@ -7,9 +7,12 @@ import {
|
|||
snakeToNormalCase,
|
||||
} from "../../utils";
|
||||
import ParameterComponent from "./components/parameterComponent";
|
||||
import { typesContext } from "../../contexts/typesContext";
|
||||
import { useContext } from "react";
|
||||
|
||||
export default function GenericNode({ data }) {
|
||||
const Icon = nodeIcons[data.type];
|
||||
const {types} = useContext(typesContext);
|
||||
|
||||
return (
|
||||
<div className="prompt-node relative bg-white w-96 rounded-lg solid border flex flex-col justify-center">
|
||||
|
|
@ -46,7 +49,7 @@ export default function GenericNode({ data }) {
|
|||
|
||||
data={data}
|
||||
color={
|
||||
nodeColors[data.types[data.node.template[t].type]] ??
|
||||
nodeColors[types[data.node.template[t].type]] ??
|
||||
"black"
|
||||
}
|
||||
title={
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue