fix ref geometry ref rerollable

This commit is contained in:
taDuc
2026-05-26 10:09:02 +07:00
parent 9d04076921
commit e403413965
4 changed files with 75 additions and 29 deletions
@@ -87,6 +87,10 @@ export default function SelectedGeometryPanel({
if (!selectedFeatures || selectedFeatures.length === 0) return null;
const representativeFeature = selectedFeatures[0];
const canRerollGeometryId =
!isBulkMode &&
representativeFeature.properties.source !== "ref" &&
Boolean(onRerollGeometryId);
const groupedGeometryTypeOptions = groupGeometryTypeOptions(GEOMETRY_TYPE_OPTIONS);
const featureGeometryPreset = resolveFeatureGeometryPreset(representativeFeature);
@@ -225,7 +229,7 @@ export default function SelectedGeometryPanel({
<div style={{ color: "#94a3b8", fontSize: "11px", overflowWrap: "anywhere", minWidth: 0, flex: 1 }}>
{isBulkMode ? `Đang chọn ${selectedFeatures.length} geometries` : `ID: ${representativeFeature.properties.id}`}
</div>
{!isBulkMode && onRerollGeometryId && (
{canRerollGeometryId && onRerollGeometryId && (
<button
type="button"
onClick={() => onRerollGeometryId(representativeFeature.properties.id)}