diff --git a/frontend/src/components/PropertiesPanel.tsx b/frontend/src/components/PropertiesPanel.tsx index 1c973f5..ee14b9e 100644 --- a/frontend/src/components/PropertiesPanel.tsx +++ b/frontend/src/components/PropertiesPanel.tsx @@ -1,4 +1,6 @@ import React, { useState, useEffect } from 'react'; +import { polygonArea } from '../tools/modification/geometry'; +import { formatArea } from '../utils/format'; import type { PropertiesPanelProps } from '../types/ui.types'; import { formatInputValue, parseDistance, type UnitType } from '../utils/format'; @@ -69,7 +71,13 @@ const PropertiesPanel: React.FC = ({ <>
- Auswahl {el ? `· ${el.type}` : ''} + Auswahl {el ? `· ${el.type} + {((el.type === 'polygon' || el.type === 'polyline') && ((el.properties.points as Array<{ x: number; y: number }> | undefined)?.length ?? 0) >= 3) && ( +
+ + {formatArea(polygonArea(el.properties.points as Array<{ x: number; y: number }>), unit, scaleFactor)} +
+ )}` : ''}
{onDelete && el && (