mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-27 21:33:41 +02:00
- Move 55 shadcn components → packages/ui/components/ui/ - Move lib/utils.ts (cn function) → packages/ui/lib/ - Move 3 DOM hooks (auto-scroll, mobile, scroll-fade) → packages/ui/hooks/ - Extract CSS design tokens (@theme + :root + .dark) → packages/ui/styles/tokens.css - Refactor 3 common components to pure-props (actor-avatar, mention-hover-card, reaction-bar) - Move 6 markdown components with renderMention slot for IssueMentionCard decoupling - Create wrapper components in apps/web/ for data-aware ActorAvatar and Markdown - Update 116 import paths across apps/web/ - Add @source directives for Tailwind to scan packages Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
31 lines
847 B
TypeScript
31 lines
847 B
TypeScript
"use client";
|
|
|
|
import { Spinner } from "@/components/spinner";
|
|
import { cn } from "@multica/ui/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>
|
|
);
|
|
}
|