mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
- Pass Loading message, class name via props to both inline and normal loading spinners - Pass loading conversation message to loading spinner when chat history is being fetched
24 lines
778 B
TypeScript
24 lines
778 B
TypeScript
import { CircleNotch } from '@phosphor-icons/react';
|
|
|
|
interface LoadingProps {
|
|
className?: string;
|
|
message?: string;
|
|
}
|
|
|
|
export default function Loading(props: LoadingProps) {
|
|
return (
|
|
// NOTE: We can display usage tips here for casual learning moments.
|
|
<div className={props.className || "bg-background opacity-50 flex items-center justify-center h-screen"}>
|
|
<div>{props.message || "Loading" } <span><CircleNotch className="inline animate-spin h-5 w-5" /></span></div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export function InlineLoading(props: LoadingProps) {
|
|
return (
|
|
<button className={`${props.className}`}>
|
|
<span>{props.message} <CircleNotch className="inline animate-spin h-5 w-5 mx-3" /></span>
|
|
</button>
|
|
)
|
|
}
|