🔄 refactor: improved RAG animations/messages (#2616)

* fix: warning slow process rag  message

* refactor: improved useProgress hook for Files
This commit is contained in:
Marco Beretta 2024-05-05 21:35:51 +02:00 committed by GitHub
parent b77bd19092
commit 2aec4a6250
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 52 additions and 11 deletions

View file

@ -20,12 +20,13 @@ const FilePreview = ({
}) => {
const radius = 55; // Radius of the SVG circle
const circumference = 2 * Math.PI * radius;
const progress = useProgress(file?.['progress'] ?? 1, 0.001);
const progress = useProgress(file?.['progress'] ?? 1, 0.001, file?.size ?? 1);
console.log(progress);
// Calculate the offset based on the loading progress
const offset = circumference - progress * circumference;
const circleCSSProperties = {
transition: 'stroke-dashoffset 0.3s linear',
transition: 'stroke-dashoffset 0.5s linear',
};
return (