import type { RefObject } from "react" import { ClipboardListIcon, MousePointerClickIcon, ZoomInIcon } from "lucide-react" import { Badge, Button, ScrollArea, Table, TableBody, TableCell, TableHead, TableRow } from "@hm-design/ui" import { formatEntityProperties } from "../engine/propertyInspector" import { FloatingPanel } from "./FloatingPanel" type Props = { open: boolean onClose: () => void anchorRef: RefObject /** Entity from Viewer2D.onSelect (null = nothing selected). */ entity: unknown onZoomToSelection: () => void } /** * Properties window. Formatting (labels, units, per-type geometry) is the ported formatEntityProperties * (src/engine/propertyInspector.ts, unchanged); only the presentation is HM (Badge + Table). */ export function PropertiesPanel({ open, onClose, anchorRef, entity, onZoomToSelection }: Props) { const prop = entity ? formatEntityProperties(entity) : null return ( } actions={ prop ? ( ) : null } open={open} onClose={onClose} slot={0} anchorRef={anchorRef} > {!prop ? (
) : (
{prop.id} {prop.geometry.length > 0 ? : null}
)}
) } function PropertyTable({ caption, rows }: { caption: string; rows: [string, string][] }) { return (

{caption}

{rows.map(([k, v], i) => ( {k} {v} ))}
) }