Fix: Fixed the issue of retrieval operator text overlapping #3221 (#8652)

### What problem does this PR solve?

Fix: Fixed the issue of retrieval operator text overlapping #3221

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2025-07-03 19:04:06 +08:00
committed by GitHub
parent 9771b521cd
commit 3234a15aae
11 changed files with 113 additions and 62 deletions

View File

@ -1,9 +1,9 @@
import { IconFont } from '@/components/icon-font';
import { Card, CardContent } from '@/components/ui/card';
import { ISwitchCondition, ISwitchNode } from '@/interfaces/database/flow';
import { NodeProps, Position } from '@xyflow/react';
import { memo, useCallback } from 'react';
import { NodeHandleId, SwitchOperatorOptions } from '../../constant';
import { LogicalOperatorIcon } from '../../form/switch-form';
import { useGetVariableLabelByValue } from '../../hooks/use-get-begin-query';
import { CommonHandle } from './handle';
import { RightHandleStyle } from './handle-icon';
@ -30,8 +30,16 @@ const ConditionBlock = ({
const getLabel = useGetVariableLabelByValue(nodeId);
const renderOperatorIcon = useCallback((operator?: string) => {
const name = SwitchOperatorOptions.find((x) => x.value === operator)?.icon;
return <IconFont name={name!}></IconFont>;
const item = SwitchOperatorOptions.find((x) => x.value === operator);
if (item) {
return (
<LogicalOperatorIcon
icon={item?.icon}
value={item?.value}
></LogicalOperatorIcon>
);
}
return <></>;
}, []);
return (