import { useFormContext } from 'react-hook-form'; import * as RadioGroup from '@radix-ui/react-radio-group'; import * as DialogPrimitive from '@radix-ui/react-dialog'; import { AuthTypeEnum, AuthorizationTypeEnum, TokenExchangeMethodEnum, } from 'librechat-data-provider'; import { DialogContent } from '~/components/ui/'; export default function ActionsAuth({ setOpenAuthDialog, }: { setOpenAuthDialog: React.Dispatch>; }) { const { watch, setValue, trigger } = useFormContext(); const type = watch('type'); return (

Authentication

setValue('type', value)} value={type} role="radiogroup" aria-required="false" dir="ltr" className="flex gap-4" tabIndex={0} style={{ outline: 'none' }} >
{type === 'none' ? null : type === 'service_http' ? : } {/* Cancel/Save */}
Cancel
); } const ApiKey = () => { const { register, watch, setValue } = useFormContext(); const authorization_type = watch('authorization_type'); const type = watch('type'); return ( <> setValue('authorization_type', value)} value={authorization_type} role="radiogroup" aria-required="true" dir="ltr" className="mb-2 flex gap-6 overflow-hidden rounded-lg" tabIndex={0} style={{ outline: 'none' }} >
{authorization_type === AuthorizationTypeEnum.Custom && (
)} ); }; const OAuth = () => { const { register, watch, setValue } = useFormContext(); const token_exchange_method = watch('token_exchange_method'); const type = watch('type'); return ( <> setValue('token_exchange_method', value)} value={token_exchange_method} role="radiogroup" aria-required="true" dir="ltr" tabIndex={0} style={{ outline: 'none' }} >
); };