diff --git a/web/app/components/plugins/plugin-auth/plugin-auth.tsx b/web/app/components/plugins/plugin-auth/plugin-auth.tsx index 0d34fcefc9..b9bd7339da 100644 --- a/web/app/components/plugins/plugin-auth/plugin-auth.tsx +++ b/web/app/components/plugins/plugin-auth/plugin-auth.tsx @@ -20,6 +20,7 @@ import { PortalToFollowElemContent, PortalToFollowElemTrigger, } from '@/app/components/base/portal-to-follow-elem' +import { SimpleSelect } from '@/app/components/base/select' import Authorize from './authorize' import Authorized from './authorized' import AddApiKeyButton from './authorize/add-api-key-button' @@ -63,7 +64,6 @@ const PluginAuth = ({ const shouldShowGuide = !!showConnectGuide const [showCredentialPanel, setShowCredentialPanel] = useState(false) const [showAddMenu, setShowAddMenu] = useState(false) - const [showEndUserTypeMenu, setShowEndUserTypeMenu] = useState(false) const configuredDisabled = !!endUserCredentialEnabled const availableEndUserTypes = useMemo(() => { const list: { value: string; label: string; icon: ReactNode }[] = [] @@ -89,10 +89,8 @@ const PluginAuth = ({ }, [availableEndUserTypes, endUserCredentialType]) useEffect(() => { - if (!endUserCredentialEnabled) { - setShowEndUserTypeMenu(false) + if (!endUserCredentialEnabled) return - } if (!availableEndUserTypes.length) return const isValid = availableEndUserTypes.some(item => item.value === endUserCredentialType) @@ -102,7 +100,6 @@ const PluginAuth = ({ const handleSelectEndUserType = useCallback((value: string) => { onEndUserCredentialTypeChange?.(value) - setShowEndUserTypeMenu(false) }, [onEndUserCredentialTypeChange]) const containerClassName = useMemo(() => { if (showConnectGuide) @@ -142,15 +139,18 @@ const PluginAuth = ({ }, [credentials, t]) const endUserSwitch = ( -