import { X } from "lucide-react"; import { isValidHistoryTimestamp, type BrowserHistoryEntry } from "~/browserHistoryStore"; import { useNowMinute } from "~/hooks/useNowMinute"; import { formatRelativeTimeLabel } from "~/timestampFormat"; import { BrowserMockup } from "./BrowserMockup"; interface Props { entry: BrowserHistoryEntry; onOpen: () => void; onRemove: () => void; } export function PreviewRecentUrlCard({ entry, onOpen, onRemove }: Props) { const parsed = new URL(entry.url); const path = parsed.pathname === "/" ? "" : parsed.pathname; const label = `${parsed.host}${path}${parsed.search}${parsed.hash}`; const visitedAt = isValidHistoryTimestamp(entry.lastVisitedAt) ? formatRelativeTimeLabel(new Date(entry.lastVisitedAt).toISOString()) : ""; useNowMinute(); return (
); }