Merge branch 'nodesImprovements' into minimizeNode

This commit is contained in:
igorrCarvalho 2023-09-12 14:28:54 -03:00
commit a0c7712b70
3 changed files with 47 additions and 36 deletions

View file

@ -118,45 +118,54 @@ export default function ParameterComponent({
nodeIconsLucide[item.family] ?? nodeIconsLucide["unknown"]; nodeIconsLucide[item.family] ?? nodeIconsLucide["unknown"];
return ( return (
<span <>
key={index} {index === 0 && (
className={classNames( <span>
index > 0 ? "mt-2 flex items-center" : "flex items-center" {left ? "Components to connect into:" : "Components to connect to:"}
)} </span>
> )
<div }
className="h-5 w-5" <span
style={{ key={index}
color: nodeColors[item.family], className={classNames(
}} index > 0 ? "mt-2 flex items-center" : "mt-3 flex items-center"
> )}
<Icon >
<div
className="h-5 w-5" className="h-5 w-5"
strokeWidth={1.5}
style={{ style={{
color: nodeColors[item.family] ?? nodeColors.unknown, color: nodeColors[item.family],
}} }}
/> >
</div> <Icon
<span className="ps-2 text-xs text-foreground"> className="h-5 w-5"
{nodeNames[item.family] ?? "Other"} strokeWidth={1.5}
<span className="text-xs"> style={{
color: nodeColors[item.family] ?? nodeColors.unknown,
}}
/>
</div>
<span className="ps-2 text-xs text-foreground">
{nodeNames[item.family] ?? "Other"}
{" "} {" "}
{item.type === "" ? "" : " - "} <span className="text-xs">
{item.type.split(", ").length > 2 {" "}
? item.type.split(", ").map((el, index) => ( {item.type === "" ? "" : " - "}
<React.Fragment key={el + index}> {item.type.split(", ").length > 2
<span> ? item.type.split(", ").map((el, index) => (
{index === item.type.split(", ").length - 1 <React.Fragment key={el + index}>
? el <span>
: (el += `, `)} {index === item.type.split(", ").length - 1
</span> ? el
</React.Fragment> : (el += `, `)}
)) </span>
: item.type} </React.Fragment>
))
: item.type}
</span>
</span> </span>
</span> </span>
</span> </>
); );
}); });
} else { } else {

View file

@ -168,8 +168,10 @@ export default function GenericNode({
</div> </div>
</div> </div>
<div className="generic-node-desc"> <div className={"generic-node-desc " + (data.node?.description !== "" ? "py-5" : "pb-5")}>
<div className="generic-node-desc-text">{data.node?.description}</div> {data.node?.description !== "" && (
<div className="generic-node-desc-text">{data.node?.description}</div>
)}
<> <>
{Object.keys(data.node!.template) {Object.keys(data.node!.template)

View file

@ -311,7 +311,7 @@
@apply hover:text-accent-foreground hover:transition-all; @apply hover:text-accent-foreground hover:transition-all;
} }
.generic-node-desc { .generic-node-desc {
@apply h-full w-full py-5 text-foreground; @apply h-full w-full text-foreground;
} }
.generic-node-desc-text { .generic-node-desc-text {
@apply w-full px-5 pb-3 text-sm text-muted-foreground; @apply w-full px-5 pb-3 text-sm text-muted-foreground;