'use client' import type { FC } from 'react' import { useTranslation } from 'react-i18next' import AlertTriangle from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback/AlertTriangle' import Input from '@/app/components/base/input' import Switch from '@/app/components/base/switch' import { API_PREFIX } from '@/config' import { cn } from '@/utils/classnames' type AuthenticationSectionProps = { isDynamicRegistration: boolean onDynamicRegistrationChange: (value: boolean) => void clientID: string onClientIDChange: (value: string) => void credentials: string onCredentialsChange: (value: string) => void } const AuthenticationSection: FC = ({ isDynamicRegistration, onDynamicRegistrationChange, clientID, onClientIDChange, credentials, onCredentialsChange, }) => { const { t } = useTranslation() return ( <>
{t('mcp.modal.useDynamicClientRegistration', { ns: 'tools' })}
{!isDynamicRegistration && (
{t('mcp.modal.redirectUrlWarning', { ns: 'tools' })}
{`${API_PREFIX}/mcp/oauth/callback`}
)}
{t('mcp.modal.clientID', { ns: 'tools' })}
onClientIDChange(e.target.value)} placeholder={t('mcp.modal.clientID', { ns: 'tools' })} disabled={isDynamicRegistration} />
{t('mcp.modal.clientSecret', { ns: 'tools' })}
onCredentialsChange(e.target.value)} placeholder={t('mcp.modal.clientSecretPlaceholder', { ns: 'tools' })} disabled={isDynamicRegistration} />
) } export default AuthenticationSection