import { useState } from 'react' import { ClockIcon, CopyIcon, ImageIcon } from 'lucide-react' import { Button } from '@/components/ui/button' import { MediaThumbnail } from '@/components/common/media-thumbnail' import { Skeleton } from '@/components/ui/skeleton' import { cn } from '@/lib/utils' export interface HistoryItemData { id: number | string name: string time: string imgUrl: string isVideo: boolean } function HistoryThumbnail ({ imgUrl, alt, isVideo = false, loadThumbnail = true, previewLabel, onPreview }: { imgUrl: string alt: string isVideo?: boolean loadThumbnail?: boolean previewLabel: string onPreview?: () => void }) { const [isLoaded, setIsLoaded] = useState(false) const [hasLoadError, setHasLoadError] = useState(false) const hasThumbnail = loadThumbnail && imgUrl.length > 0 && !hasLoadError return ( ) } export function HistoryItem ({ item, onCopy, loadThumbnail = true, onPreview, previewLabel }: { item: HistoryItemData onCopy?: () => void loadThumbnail?: boolean onPreview?: () => void previewLabel: string }) { return (