"use client" import { motion } from "framer-motion" import { X } from "lucide-react" import { tileUrl } from "@/lib/api" import type { Hit } from "@/lib/types" import { Button } from "@/components/ui/button" interface ComparePanelProps { hits: Hit[] allHits: Hit[] onClose: () => void } export function ComparePanel({ hits, allHits, onClose }: ComparePanelProps) { return ( {/* Header */}

Comparing {hits.length} tiles

{/* Tiles */}
{hits.map((hit) => { const globalRank = allHits.findIndex((h) => h.vector_id === hit.vector_id) + 1 const slug = hit.url.split("/wiki/").pop() ?? "" const title = decodeURIComponent(slug).replace(/_/g, " ") || `Article #${hit.article_id}` return (
{/* Image */}
{/* eslint-disable-next-line @next/next/no-img-element */} {`Tile
{/* Metadata */}
{title}
Score {hit.score.toFixed(3)}
Rank #{globalRank}
Tile height {hit.tile_height}px
Vector ID {hit.vector_id}
) })}
) }