gendesign/frontend/src/components/site-finder/ptica/DevelopmentScan.tsx
bot-backend 5a73f1d0b6
All checks were successful
Deploy / build-backend (push) Has been skipped
Deploy / changes (push) Successful in 7s
Deploy / build-worker (push) Has been skipped
Deploy / build-frontend (push) Successful in 3m18s
Deploy / deploy (push) Successful in 1m10s
feat(cockpit): поверхностить financial_estimate в Development Scan / Investment Clearance (#1881 rank-5) (#1894)
feat(cockpit): поверхностить financial_estimate в Development Scan / Investment Clearance (#1881 rank-5)
2026-06-24 16:20:19 +00:00

95 lines
3.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use client";
/**
* DevelopmentScan — "Development Scan" section: a 7-card grid of ScanCards
* (Градостроительство / Ограничения / Инженерия / Рынок / Экономика / Риски /
* Среда), matching the prototype scan-grid. ОКС and Инсоляция live in the
* lower-grid (PticaLowerGrid). Every card's real-vs-placeholder content comes
* from the adapter.
*
* Each card maps to its drawer key and opens the matching detail drawer via the
* `onOpenDrawer` callback threaded down from PticaPageContent.
*/
import styles from "@/app/site-finder/analysis/[cad]/ptica/ptica.module.css";
import type { ParcelAnalysis } from "@/types/site-finder";
import { ScanCard } from "@/components/site-finder/ptica/ScanCard";
import { BuildabilityGauge } from "@/components/site-finder/ptica/BuildabilityGauge";
import {
adaptUrbanCard,
adaptRestrictionsCard,
adaptEngineeringCard,
adaptMarketCard,
adaptEconomyCard,
adaptEnvironmentCard,
adaptRiskGauge,
} from "@/components/site-finder/ptica/ptica-adapt";
import type { DrawerKey } from "@/components/site-finder/ptica/drawers/drawer-keys";
interface Props {
analysis: ParcelAnalysis;
onOpenDrawer: (key: DrawerKey) => void;
}
export function DevelopmentScan({ analysis, onOpenDrawer }: Props) {
const riskGauge = adaptRiskGauge(analysis);
return (
<>
<div className={styles.sectionLabel}>
Development Scan · <b>градостроительный анализ</b>
</div>
<section className={styles.scanGrid}>
<ScanCard
card={adaptUrbanCard(analysis)}
drawerKey="urban"
onOpen={onOpenDrawer}
/>
<ScanCard
card={adaptRestrictionsCard(analysis)}
drawerKey="restrictions"
onOpen={onOpenDrawer}
/>
<ScanCard
card={adaptEngineeringCard(analysis)}
drawerKey="engineering"
onOpen={onOpenDrawer}
/>
<ScanCard
card={adaptMarketCard(analysis)}
drawerKey="market"
onOpen={onOpenDrawer}
/>
<ScanCard
card={adaptEconomyCard(analysis.financial_estimate)}
drawerKey="economy"
onOpen={onOpenDrawer}
/>
<div
id="ptica-risks"
className={`${styles.card} ${styles.scanCard} ${styles.scanCardCentered}`}
>
<h3 className={styles.cardTitle}>Риски</h3>
<BuildabilityGauge gauge={riskGauge} title="Сводный риск" />
<button
type="button"
className={`${styles.detailBtn} ${styles.detailBtnScan}`}
onClick={() => onOpenDrawer("risks")}
title="Открыть детализацию"
>
Подробнее
</button>
</div>
<ScanCard
card={adaptEnvironmentCard(analysis)}
drawerKey="environment"
onOpen={onOpenDrawer}
/>
{/* ОКС and Инсоляция · 3D-масса live in the lower-grid (PticaLowerGrid)
per the prototype, keeping the scan at 7 cards. */}
</section>
</>
);
}