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,7 +187,8 @@ export default function NodeToolbarComponent({
</SelectTrigger> </SelectTrigger>
</ShadTooltip> </ShadTooltip>
<SelectContent> <SelectContent>
<SelectItem value={nodeLength == 0 ? "disabled" : "advanced"}> {nodeLength > 0 && (
<SelectItem value={nodeLength === 0 ? "disabled" : "advanced"}>
<div className="flex"> <div className="flex">
<IconComponent <IconComponent
name="Settings2" name="Settings2"
@ -196,6 +197,8 @@ export default function NodeToolbarComponent({
Edit{" "} Edit{" "}
</div>{" "} </div>{" "}
</SelectItem> </SelectItem>
)}
<SelectItem value={"SaveAll"}> <SelectItem value={"SaveAll"}>
<div className="flex"> <div className="flex">
<IconComponent <IconComponent