mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 03:10:15 +01:00
🎹 fix: Autocompletion Chrome Bug on Action API Key Input
chore: remove `useOriginNavigate`
chore: set correct OpenAI Storage Source
fix: azure file deletions, instantiate clients by source for deletion
update code interpret files info
feat: deleteResourceFileId
chore: increase poll interval as azure easily rate limits
fix: openai file deletions, TODO: evaluate rejected deletion settled promises to determine which to delete from db records
file source icons
update table file filters
chore: file search info and versioning
fix: retrieval update with necessary tool_resources if specified
fix(useMentions): add optional chaining in case listMap value is undefined
fix: force assistant avatar roundedness
fix: azure assistants, check correct flag
chore: bump data-provider
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import type { TFile } from 'librechat-data-provider';
|
|
import type { ExtendedFile } from '~/common';
|
|
import FileIcon from '~/components/svg/Files/FileIcon';
|
|
import ProgressCircle from './ProgressCircle';
|
|
import SourceIcon from './SourceIcon';
|
|
import { useProgress } from '~/hooks';
|
|
import { cn } from '~/utils';
|
|
|
|
const FilePreview = ({
|
|
file,
|
|
fileType,
|
|
className = '',
|
|
}: {
|
|
file?: ExtendedFile | TFile;
|
|
fileType: {
|
|
paths: React.FC;
|
|
fill: string;
|
|
title: string;
|
|
};
|
|
className?: string;
|
|
}) => {
|
|
const radius = 55; // Radius of the SVG circle
|
|
const circumference = 2 * Math.PI * radius;
|
|
const progress = useProgress(file?.['progress'] ?? 1, 0.001, (file as ExtendedFile)?.size ?? 1);
|
|
|
|
// Calculate the offset based on the loading progress
|
|
const offset = circumference - progress * circumference;
|
|
const circleCSSProperties = {
|
|
transition: 'stroke-dashoffset 0.5s linear',
|
|
};
|
|
|
|
return (
|
|
<div className={cn('h-10 w-10 shrink-0 overflow-hidden rounded-md', className)}>
|
|
<FileIcon file={file} fileType={fileType} />
|
|
<SourceIcon source={file?.source} />
|
|
{progress < 1 && (
|
|
<ProgressCircle
|
|
circumference={circumference}
|
|
offset={offset}
|
|
circleCSSProperties={circleCSSProperties}
|
|
/>
|
|
)}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default FilePreview;
|