import { Clock, History, X } from "lucide-react"; import { Globe } from "lucide-react"; import type { DomainHistoryItem } from "@/client/features/domain/types"; type Props = { historyLoaded: boolean; history: DomainHistoryItem[]; onClearHistory: () => void; onRemoveHistoryItem: (timestamp: number) => void; onSelectHistoryItem: (item: DomainHistoryItem) => void; }; export function DomainHistorySection({ historyLoaded, history, onClearHistory, onRemoveHistoryItem, onSelectHistoryItem, }: Props) { if (!historyLoaded || history.length === 0) { return ( Enter a domain to get started ); } return ( {history.length} recent search{history.length !== 1 ? "es" : ""} Clear all {history.map((item) => ( onSelectHistoryItem(item)} > {item.domain} {item.subdomains ? "Include subdomains" : "Root domain only"} {item.search?.trim() ? ` - ${item.search}` : ""} {new Date(item.timestamp).toLocaleDateString(undefined, { month: "short", day: "numeric", })} { event.stopPropagation(); onRemoveHistoryItem(item.timestamp); }} > ))} ); }
Enter a domain to get started
{item.domain}
{item.subdomains ? "Include subdomains" : "Root domain only"} {item.search?.trim() ? ` - ${item.search}` : ""}