'use client' import { useLayoutEffect, useRef } from 'react' import { Skeleton } from './ui/skeleton' // Matches Tailwind's animate-pulse duration const PULSE_MS = 2000 export const DefaultSkeleton = () => { // The route loading skeleton is replaced by the chat's own skeleton while // history loads; a wall-clock phase keeps the pulse from restarting. const ref = useRef(null) useLayoutEffect(() => { ref.current?.getAnimations?.({ subtree: true }).forEach(animation => { animation.currentTime = Date.now() % PULSE_MS }) }, []) return (
{[...Array(2)].map((_, index) => ( ))}
) } export function SearchSkeleton() { return (
{[...Array(4)].map((_, index) => ( ))}
{[...Array(3)].map((_, index) => (
))}
) }