diff --git a/frontend/src/app/site-finder/page.tsx b/frontend/src/app/site-finder/page.tsx index 41d7f8b7..58bc394f 100644 --- a/frontend/src/app/site-finder/page.tsx +++ b/frontend/src/app/site-finder/page.tsx @@ -152,8 +152,19 @@ export default function SiteFinderPage() { - {/* Right column — map + competitors */} -
+ {/* Right column — map + competitors (sticky) */} +
+ + {open &&
{children}
} +
+ ); +} + // ── Noise block ─────────────────────────────────────────────────────────────── function NoiseBlock({ noise }: { noise: ParcelAnalysisNoise }) { @@ -536,6 +575,12 @@ export function ScoreCard({ data, onIsochronesResult }: Props) { data.wind !== undefined || data.weather !== undefined; + const scoreLabelTyped = data.score_label as ScoreLabel | undefined; + const badgeBg = scoreLabelTyped ? SCORE_LABEL_BG[scoreLabelTyped] : "#f3f4f6"; + const badgeFg = scoreLabelTyped + ? SCORE_LABEL_COLOR[scoreLabelTyped] + : "#6b7280"; + return (
- {/* Score header */} + {/* Sticky score header */}
-
- {data.score.toFixed(2)} -
-
- {/* score_max_reference + label badge */} -
- {data.score_max_reference !== undefined && ( - - / {data.score_max_reference.toFixed(0)} - - )} - {data.score_label && ( - - {data.score_label} - - )} -
-
- Социальный балл участка -
-
- {data.poi_count} POI ·{" "} - {data.source === "cad_quarter" ? "квартал" : "участок"} -
- {data.score_explanation && ( -
- {data.score_explanation} -
+
+ + {data.score.toFixed(2)} + + {data.score_max_reference !== undefined && ( + + / {data.score_max_reference.toFixed(0)} + )} - {data.location && }
+ {scoreLabelTyped && ( + + {scoreLabelTyped} + + )} +
+ + {/* Score detail (expanded) */} +
+
+ Социальный балл участка +
+
+ {data.poi_count} POI ·{" "} + {data.source === "cad_quarter" ? "квартал" : "участок"} +
+ {data.score_explanation && ( +
+ {data.score_explanation} +
+ )} + {data.location && }
{/* District */} {data.district && (
+
- {/* Environmental factors */} + {/* Environmental factors (primary — open) */} {hasEnvironmental && (
)} - {/* Market trend */} + {/* Market Trend (primary — open) */} {"market_trend" in data && (
)} - {/* Success recommendation */} - {"success_recommendation" in data && ( -
- -
- )} - - {/* Seasonal weather */} - {"seasonal_weather" in data && ( -
- -
- )} - - {/* Hydrology */} - {data.hydrology !== undefined && ( -
- -
- )} - - {/* Geotech risk */} - {data.geotech_risk !== undefined && ( -
- -
- )} - - {/* Geology */} - {data.geology !== undefined && ( -
-
- Геология -
- -
- )} - - {/* Isochrones */} + {/* Isochrones (primary — open) */} {data.isochrones_available === false ? (
) : data.isochrones_available === true && onIsochronesResult ? ( - +
+ +
) : null} + + {/* Success recommendation (secondary — collapsed) */} + {"success_recommendation" in data && ( + + + + )} + + {/* Seasonal weather (secondary — collapsed) */} + {"seasonal_weather" in data && ( + + + + )} + + {/* Hydrology (secondary — collapsed) */} + {data.hydrology !== undefined && ( + + + + )} + + {/* Geotech risk (secondary — collapsed) */} + {data.geotech_risk !== undefined && ( + + + + )} + + {/* Geology (secondary — collapsed) */} + {data.geology !== undefined && ( + +
+ Геология +
+ +
+ )}
); }