import { useState } from 'react'; import { Copy, CopyCheck } from 'lucide-react'; import { useFormContext } from 'react-hook-form'; import { AuthTypeEnum } from 'librechat-data-provider'; import { Button, useToastContext } from '@librechat/client'; import { useLocalize, useCopyToClipboard } from '~/hooks'; import { cn } from '~/utils'; export default function ActionCallback({ action_id }: { action_id?: string }) { const localize = useLocalize(); const { watch } = useFormContext(); const { showToast } = useToastContext(); const [isCopying, setIsCopying] = useState(false); const callbackURL = `${window.location.protocol}//${window.location.host}/api/actions/${action_id}/oauth/callback`; const copyLink = useCopyToClipboard({ text: callbackURL }); if (!action_id) { return null; } const type = watch('type'); if (type !== AuthTypeEnum.OAuth) { return null; } return (
); }