Files
khoj/src/interface/web/app/components/loading/loading.tsx
Debanjum Singh Solanky c2bf405489 Make loading message, styling configurable. Do not show agent when no data
- 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
2024-07-14 13:00:36 +05:30

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>
)
}