import React from 'react'; import { Skeleton } from '@/components/ui/skeleton'; import { ChatInput } from '@/components/thread/chat-input/chat-input'; import { cn } from '@/lib/utils'; interface ThreadSkeletonProps { isSidePanelOpen?: boolean; showHeader?: boolean; messageCount?: number; } export function ThreadSkeleton({ isSidePanelOpen = false, showHeader = true, messageCount = 3, }: ThreadSkeletonProps) { // Mock handlers for the ChatInput component const handleSubmit = (message: string) => { // No-op for skeleton console.log('Skeleton submit:', message); }; const handleChange = (value: string) => { // No-op for skeleton console.log('Skeleton change:', value); }; return (
{/* Skeleton Header */} {showHeader && (
)} {/* Skeleton Chat Messages */}
{/* Generate multiple message skeletons based on messageCount */} {Array.from({ length: messageCount }).map((_, index) => ( {/* User message - every other message */} {index % 2 === 0 ? (
) : ( /* Assistant response with tool usage */
{/* Tool call button skeleton */} {index % 3 === 1 && (
)} {index % 3 === 1 && (
)}
)}
))} {/* Assistant thinking state */}
{/* ChatInput - Inside the left div, positioned at bottom with exact same styling */}
{/* Side Panel - Always visible in skeleton with exact responsive widths */}
); }