fix(nodeToolbarComponent): refactor condition for rendering Edit option in SelectItem to improve readability and maintainability

This commit is contained in:
cristhianzl 2023-11-20 17:57:22 -03:00
commit b1890bdaf9

View file

@ -187,15 +187,18 @@ export default function NodeToolbarComponent({
</SelectTrigger> </SelectTrigger>
</ShadTooltip> </ShadTooltip>
<SelectContent> <SelectContent>
<SelectItem value={nodeLength == 0 ? "disabled" : "advanced"}> {nodeLength > 0 && (
<div className="flex"> <SelectItem value={nodeLength === 0 ? "disabled" : "advanced"}>
<IconComponent <div className="flex">
name="Settings2" <IconComponent
className="relative top-0.5 mr-2 h-4 w-4" name="Settings2"
/>{" "} className="relative top-0.5 mr-2 h-4 w-4"
Edit{" "} />{" "}
</div>{" "} Edit{" "}
</SelectItem> </div>{" "}
</SelectItem>
)}
<SelectItem value={"SaveAll"}> <SelectItem value={"SaveAll"}>
<div className="flex"> <div className="flex">
<IconComponent <IconComponent