/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /** * Coordinate display components for entity position information. */ import { Copy, Check } from 'lucide-react'; /** Inline coordinate value with dim axis label */ export function CoordVal({ axis, value }: { axis: string; value: number }) { return ( {axis}{'\u2009'}{value.toFixed(3)} ); } /** Copyable coordinate row: label + values with copy button hugging the values */ export function CoordRow({ label, values, primary, copyLabel, coordCopied, onCopy }: { label: string; values: { axis: string; value: number }[]; primary?: boolean; copyLabel: string; coordCopied: string | null; onCopy: (label: string, text: string) => void; }) { const isCopied = coordCopied === copyLabel; const copyText = values.map(v => v.value.toFixed(3)).join(', '); return (
{label && ( {label} )} {values.map((v, i) => ( {i > 0 && <>{' '}} ))}
); }