'use client' import { ExternalLink, Calendar as CalendarIcon, Clock } from 'lucide-react' import { Badge } from '@/components/ui/badge' import { cn } from '@/lib/utils' import type { Bookmark } from '@/components/app-shell' interface BookmarkCardProps { bookmark: Bookmark onClick?: () => void compact?: boolean } export function BookmarkCard({ bookmark, onClick, compact }: BookmarkCardProps) { const domain = (() => { try { return new URL(bookmark?.url ?? '').hostname } catch { return '' } })() const tags = bookmark?.tags ?? [] return (
{!compact && bookmark?.ogImage && (
{bookmark?.title { e.target.style.display = 'none' }} />
)}
{bookmark?.favicon && ( { e.target.style.display = 'none' }} /> )}

{bookmark?.title ?? bookmark?.url ?? 'Untitled'}

{domain}

e.stopPropagation()} className="shrink-0 opacity-0 group-hover:opacity-100 transition-opacity" >
{!compact && bookmark?.ogDescription && (

{bookmark.ogDescription}

)}
{tags.slice(0, 3).map((bt: any) => ( {bt?.tag?.name ?? ''} ))} {tags.length > 3 && ( +{tags.length - 3} )}
{(bookmark?.dueDate || bookmark?.alertAt) && (
{bookmark?.dueDate && ( {new Date(bookmark.dueDate).toLocaleDateString('en-US', { month: 'short', day: 'numeric', timeZone: 'UTC' })} )} {bookmark?.alertAt && ( Alert set )}
)}
) }