mirror of
https://github.com/onyx-dot-app/onyx.git
synced 2026-10-22 19:32:55 -05:00
Adds: - name for connector credential pairs + frontend changes to start populating this field - document set table migration - during indexing, document sets are now checked and inserted into Vespa - background job to check if document sets need to be synced - document set management APIs - document set management dashboard in the UI
63 lines
1.3 KiB
TypeScript
63 lines
1.3 KiB
TypeScript
import React, { useState, useEffect } from "react";
|
|
import "./loading.css";
|
|
import { ThreeDots } from "react-loader-spinner";
|
|
|
|
interface LoadingAnimationProps {
|
|
text?: string;
|
|
size?: "text-sm" | "text-md";
|
|
}
|
|
|
|
export const LoadingAnimation: React.FC<LoadingAnimationProps> = ({
|
|
text,
|
|
size,
|
|
}) => {
|
|
const [dots, setDots] = useState("...");
|
|
|
|
useEffect(() => {
|
|
const interval = setInterval(() => {
|
|
setDots((prevDots) => {
|
|
switch (prevDots) {
|
|
case ".":
|
|
return "..";
|
|
case "..":
|
|
return "...";
|
|
case "...":
|
|
return ".";
|
|
default:
|
|
return "...";
|
|
}
|
|
});
|
|
}, 500);
|
|
|
|
return () => clearInterval(interval);
|
|
}, []);
|
|
|
|
return (
|
|
<div className="loading-animation flex">
|
|
<div className={"mx-auto flex" + size ? ` ${size}` : ""}>
|
|
{text === undefined ? "Thinking" : text}
|
|
<span className="dots">{dots}</span>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export const ThreeDotsLoader = () => {
|
|
return (
|
|
<div className="flex my-auto">
|
|
<div className="mx-auto">
|
|
<ThreeDots
|
|
height="30"
|
|
width="50"
|
|
color="#3b82f6"
|
|
ariaLabel="grid-loading"
|
|
radius="12.5"
|
|
wrapperStyle={{}}
|
|
wrapperClass=""
|
|
visible={true}
|
|
/>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|