diff --git a/web/app/components/workflow/nodes/_base/components/form-input-item.tsx b/web/app/components/workflow/nodes/_base/components/form-input-item.tsx index d861a9e1c9..fa60e8a28b 100644 --- a/web/app/components/workflow/nodes/_base/components/form-input-item.tsx +++ b/web/app/components/workflow/nodes/_base/components/form-input-item.tsx @@ -23,7 +23,7 @@ import { CodeLanguage } from '@/app/components/workflow/nodes/code/types' import cn from '@/utils/classnames' import { Listbox, ListboxButton, ListboxOption, ListboxOptions } from '@headlessui/react' import { ChevronDownIcon } from '@heroicons/react/20/solid' -import { RiCheckLine } from '@remixicon/react' +import { RiCheckLine, RiLoader4Line } from '@remixicon/react' type Props = { readOnly: boolean nodeId: string @@ -304,19 +304,21 @@ const FormInputItem: FC = ({ onChange={handleValueChange} disabled={readOnly} > -
- - +
+ + 0 ? 'text-components-input-text-filled' : 'text-components-input-text-placeholder', + )}> {getSelectedLabels(varInput?.value) || placeholder?.[language] || placeholder?.en_US || 'Select options'} - + - + {options.filter((option: { show_on: any[] }) => { if (option.show_on?.length) return option.show_on.every(showOnItem => value[showOnItem.variable] === showOnItem.value) @@ -326,9 +328,9 @@ const FormInputItem: FC = ({ key={option.value} value={option.value} className={({ focus }) => - `relative cursor-pointer select-none py-2 pl-10 pr-4 ${ - focus ? 'bg-state-base-hover text-text-secondary' : 'text-text-primary' - }` + cn('relative cursor-pointer select-none rounded-lg py-2 pl-3 pr-9 text-text-secondary hover:bg-state-base-hover', + focus && 'bg-state-base-hover', + ) } > {({ selected }) => ( @@ -337,12 +339,12 @@ const FormInputItem: FC = ({ {option.icon && ( )} - + {option.label[language] || option.label.en_US}
{selected && ( - + )} @@ -388,21 +390,28 @@ const FormInputItem: FC = ({ onChange={handleValueChange} disabled={readOnly || isLoadingOptions} > -
- - +
+ + 0 ? 'text-components-input-text-filled' : 'text-components-input-text-placeholder', + )}> {isLoadingOptions ? 'Loading...' : getSelectedLabels(varInput?.value) || placeholder?.[language] || placeholder?.en_US || 'Select options'} - - - + {(dynamicOptions || options || []).filter((option: { show_on?: any[] }) => { if (option.show_on?.length) return option.show_on.every(showOnItem => value[showOnItem.variable] === showOnItem.value) @@ -412,9 +421,9 @@ const FormInputItem: FC = ({ key={option.value} value={option.value} className={({ focus }) => - `relative cursor-pointer select-none py-2 pl-10 pr-4 ${ - focus ? 'bg-state-base-hover text-text-secondary' : 'text-text-primary' - }` + cn('relative cursor-pointer select-none rounded-lg py-2 pl-3 pr-9 text-text-secondary hover:bg-state-base-hover', + focus && 'bg-state-base-hover', + ) } > {({ selected }) => ( @@ -423,12 +432,12 @@ const FormInputItem: FC = ({ {option.icon && ( )} - + {option.label[language] || option.label.en_US}
{selected && ( - + )}