Migrate all shadcn components into apps/web/components/ui/ so the web app is fully independent from packages/ui for its UI layer. Update to the latest shadcn base-nova style. Add missing semantic color variables (success, warning, info, canvas), font-mono mapping, scrollbar styling, and wrap Select items in SelectGroup for proper padding. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
30 lines
837 B
TypeScript
30 lines
837 B
TypeScript
"use client";
|
|
|
|
import { Spinner } from "@/components/spinner";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
export type LoadingVariant = "generating" | "streaming";
|
|
|
|
interface LoadingIndicatorProps {
|
|
variant: LoadingVariant;
|
|
className?: string;
|
|
}
|
|
|
|
const VARIANT_TEXT: Record<LoadingVariant, string> = {
|
|
generating: "Generating...",
|
|
streaming: "Streaming...",
|
|
};
|
|
|
|
/**
|
|
* Unified loading indicator for chat.
|
|
* Use "generating" when waiting for AI response (no content yet).
|
|
* Use "streaming" when content is actively being received.
|
|
*/
|
|
export function LoadingIndicator({ variant, className }: LoadingIndicatorProps) {
|
|
return (
|
|
<div className={cn("flex items-center gap-2 py-1 text-muted-foreground", className)}>
|
|
<Spinner className="text-xs" />
|
|
<span className="text-xs">{VARIANT_TEXT[variant]}</span>
|
|
</div>
|
|
);
|
|
}
|