chore: Refactor ParameterComponent handle button rendering

This commit refactors the rendering of the handle button in the ParameterComponent. It improves the readability and maintainability of the code by simplifying the logic and removing unnecessary ternary operators.
This commit is contained in:
anovazzi1 2024-05-29 20:36:37 -03:00
commit 0ae9d8db6a
2 changed files with 25 additions and 21 deletions

View file

@ -258,6 +258,7 @@ export default function ParameterComponent({
<span className={!left && data.node?.frozen ? " text-ice" : ""}> <span className={!left && data.node?.frozen ? " text-ice" : ""}>
{title} {title}
</span> </span>
{!left && (
<ShadTooltip <ShadTooltip
content={ content={
displayOutputPreview displayOutputPreview
@ -276,10 +277,11 @@ export default function ParameterComponent({
? "" ? ""
: " cursor-not-allowed text-muted-foreground", : " cursor-not-allowed text-muted-foreground",
)} )}
name={"Eye"} name={"ScanEye"}
/> />
</button> </button>
</ShadTooltip> </ShadTooltip>
)}
</div> </div>
)} )}
<span className={(required ? "ml-2 " : "") + "text-status-red"}> <span className={(required ? "ml-2 " : "") + "text-status-red"}>

View file

@ -53,6 +53,7 @@ import {
FileType2, FileType2,
FileUp, FileUp,
FlaskConical, FlaskConical,
ScanEye,
FolderIcon, FolderIcon,
FolderPlus, FolderPlus,
FolderPlusIcon, FolderPlusIcon,
@ -397,6 +398,7 @@ export const nodeIconsLucide: iconsType = {
textsplitters: Scissors, textsplitters: Scissors,
wrappers: Gift, wrappers: Gift,
helpers: Wand2, helpers: Wand2,
ScanEye,
experimental: FlaskConical, experimental: FlaskConical,
langchain_utilities: PocketKnife, langchain_utilities: PocketKnife,
WolframAlphaAPIWrapper: SvgWolfram, WolframAlphaAPIWrapper: SvgWolfram,