import * as Popover from '@radix-ui/react-popover'; import { Spinner } from '@librechat/client'; import { ChevronDown, ChevronUp } from 'lucide-react'; import CancelledIcon from './CancelledIcon'; import FinishedIcon from './FinishedIcon'; import { cn } from '~/utils'; const wrapperClass = 'progress-text-wrapper text-token-text-secondary relative -mt-[0.75px] h-5 w-full leading-5'; const Wrapper = ({ popover, children }: { popover: boolean; children: React.ReactNode }) => { if (popover) { return (
{children}
); } return (
{children}
); }; export default function ProgressText({ progress, onClick, inProgressText, finishedText, authText, hasInput = true, popover = false, isExpanded = false, error = false, }: { progress: number; onClick?: () => void; inProgressText: string; finishedText: string; authText?: string; hasInput?: boolean; popover?: boolean; isExpanded?: boolean; error?: boolean; }) { const getText = () => { if (error) { return finishedText; } if (progress < 1) { return authText ?? inProgressText; } return finishedText; }; const getIcon = () => { if (error) { return ; } if (progress < 1) { return ; } return ; }; const text = getText(); const icon = getIcon(); const showShimmer = progress < 1 && !error; return ( ); }