feat: enhance condition node form to improve branch display with updated labels and styling
This commit is contained in:
@@ -103,19 +103,17 @@ function ConditionNodeForm({ fallbackTitle }: { fallbackTitle: string }) {
|
|||||||
return (
|
return (
|
||||||
<div className="px-4 py-3">
|
<div className="px-4 py-3">
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
{branches.map((branch) => (
|
{branches.map((branch, index) => (
|
||||||
<div
|
<div
|
||||||
key={branch.id}
|
key={branch.id}
|
||||||
className="relative flex min-h-10 items-center gap-2 rounded-md bg-[#eef1f7] px-3 py-2 pr-6 text-xs transition-colors before:absolute before:bottom-2 before:left-0 before:top-2 before:w-0.5 before:rounded-full before:bg-[#4e40e5] hover:bg-[#e6eaff]"
|
className="relative flex min-h-10 items-center gap-2 rounded-md bg-[#eef1f7] px-3 text-xs transition-colors before:absolute before:bottom-2 before:left-0 before:top-2 before:w-0.5 before:rounded-full before:bg-[#4e40e5] hover:bg-[#e6eaff]"
|
||||||
>
|
>
|
||||||
<span className="min-w-0 flex-1 truncate font-medium text-foreground/90">
|
<span className="min-w-0 flex-1 truncate font-medium text-foreground/90">
|
||||||
{branch.name || (branch.default ? "默认分支" : branch.id)}
|
{branch.name || (branch.default ? "默认分支" : branch.id)}
|
||||||
</span>
|
</span>
|
||||||
{branch.default ? (
|
<span className="shrink-0 rounded-sm bg-[#e7e9f3] px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground">
|
||||||
<span className="shrink-0 rounded-sm bg-[#e7e9f3] px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground">
|
{branch.default ? "else" : index === 0 ? "if" : "elseif"}
|
||||||
else
|
</span>
|
||||||
</span>
|
|
||||||
) : null}
|
|
||||||
<span
|
<span
|
||||||
data-port-id={branch.id}
|
data-port-id={branch.id}
|
||||||
data-port-type="output"
|
data-port-type="output"
|
||||||
|
|||||||
Reference in New Issue
Block a user