5561bc6b22
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
import { Ruler, X } from 'lucide-react';
|
|
import { Button } from '@/components/ui/button';
|
|
import { useModelStore } from '@/stores/useModelStore';
|
|
|
|
export function MeasurementsList() {
|
|
const { measurements, removeMeasurement, scaleRatio } = useModelStore();
|
|
|
|
if (measurements.length === 0) return null;
|
|
|
|
return (
|
|
<div className="space-y-2">
|
|
<div className="flex items-center justify-between">
|
|
<h3 className="font-mono text-xs font-semibold uppercase tracking-widest text-muted-foreground">
|
|
Medições
|
|
</h3>
|
|
<span className="font-mono text-[10px] text-primary" title="Valores em mm reais (compensados pela escala)">
|
|
mm reais · {scaleRatio.label}
|
|
</span>
|
|
</div>
|
|
<div className="space-y-1.5">
|
|
{measurements.map((m, i) => (
|
|
<div key={m.id} className="flex items-center justify-between rounded-lg border bg-muted/30 px-3 py-2">
|
|
<div className="flex items-center gap-2">
|
|
<Ruler className="h-3.5 w-3.5 text-success" />
|
|
<span className="font-mono text-xs text-foreground">
|
|
M{i + 1}: <span className="text-success font-bold">{m.distanceMM.toFixed(1)} mm</span>
|
|
</span>
|
|
</div>
|
|
<Button
|
|
variant="ghost"
|
|
size="icon"
|
|
className="h-6 w-6"
|
|
onClick={() => removeMeasurement(m.id)}
|
|
>
|
|
<X className="h-3 w-3 text-muted-foreground" />
|
|
</Button>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|