Per audit batch #127 P2 hygiene (issue #129). Previous commit лошил файлы из-за pre-commit (видимо). Fixup-коммит с actual diff: ## New shared modules (3) - frontend/src/components/ui/SectionLabel.tsx - frontend/src/components/ui/EmptyState.tsx - frontend/src/lib/adminStyles.ts ## Replacements - SectionLabel: 12 inline usages → import (Overview/Land/Market/Environment Tab) - EmptyState: 3 inline usages → import (Land/Market/Environment) - adminStyles: 5 admin pages import cardStyle/labelStyle/inputStyle/th/td - BulkGeoPanel: cardStyle only (preserves local labelStyle для span) - leads/page.tsx: cardStyle с marginTop extend; th/td/inputStyle local (divergent) ## Visual regression: ZERO All px/colors/CSS properties copied verbatim. Files с divergent values left local. ## Checks - ruff (no files) - prettier - tsc + lint clean (per agent run) Closes #129 Refs: #127
100 lines
3.2 KiB
TypeScript
100 lines
3.2 KiB
TypeScript
"use client";
|
||
|
||
import type { ParcelAnalysis } from "@/types/site-finder";
|
||
import { SectionLabel } from "@/components/ui/SectionLabel";
|
||
import { EmptyState } from "@/components/ui/EmptyState";
|
||
import { GeologyBlock } from "./GeologyBlock";
|
||
import { GeometrySuitabilityBlock } from "./GeometrySuitabilityBlock";
|
||
import { GeotechRiskBlock } from "./GeotechRiskBlock";
|
||
import { NeighborsBlock } from "./NeighborsBlock";
|
||
|
||
interface Props {
|
||
data: ParcelAnalysis;
|
||
}
|
||
|
||
export function LandTab({ data }: Props) {
|
||
const hasAny =
|
||
data.geotech_risk !== undefined ||
|
||
data.geology !== undefined ||
|
||
data.geometry_suitability !== undefined ||
|
||
data.neighbors_summary !== undefined;
|
||
|
||
return (
|
||
<div style={{ display: "flex", flexDirection: "column", gap: 20 }}>
|
||
{/* P2 (#46) — Соседи + overlap warning (hard warn если overlap) */}
|
||
{data.neighbors_summary && (
|
||
<NeighborsBlock data={data.neighbors_summary} />
|
||
)}
|
||
|
||
{/* P1 (#45) — Geometry suitability */}
|
||
{data.geometry_suitability !== undefined && (
|
||
<GeometrySuitabilityBlock data={data.geometry_suitability} />
|
||
)}
|
||
|
||
{/* Zoning note */}
|
||
<div
|
||
style={{
|
||
background: "#f9fafb",
|
||
border: "1px solid #e5e7eb",
|
||
borderRadius: 10,
|
||
padding: "14px 18px",
|
||
}}
|
||
>
|
||
<SectionLabel style={{ marginBottom: 8 }}>
|
||
Зонирование (ПЗЗ)
|
||
</SectionLabel>
|
||
<div style={{ fontSize: 13, color: "#6b7280" }}>
|
||
Данные ПЗЗ доступны через{" "}
|
||
<a
|
||
href="https://pkk.rosreestr.ru/"
|
||
target="_blank"
|
||
rel="noopener noreferrer"
|
||
style={{ color: "#1d4ed8", textDecoration: "none" }}
|
||
>
|
||
Публичную кадастровую карту
|
||
</a>
|
||
. API Росреестра закрыт в 2024 — используйте deep-link для кад. номера{" "}
|
||
<strong style={{ color: "#374151" }}>{data.cad_num}</strong>.
|
||
</div>
|
||
<a
|
||
href={`https://pkk.rosreestr.ru/#/search/${encodeURIComponent(data.cad_num)}`}
|
||
target="_blank"
|
||
rel="noopener noreferrer"
|
||
style={{
|
||
display: "inline-block",
|
||
marginTop: 10,
|
||
padding: "6px 14px",
|
||
background: "#1d4ed8",
|
||
color: "#fff",
|
||
borderRadius: 6,
|
||
fontSize: 13,
|
||
fontWeight: 500,
|
||
textDecoration: "none",
|
||
}}
|
||
>
|
||
Открыть в ПКК
|
||
</a>
|
||
</div>
|
||
|
||
{/* Geotech risk */}
|
||
{data.geotech_risk !== undefined && (
|
||
<div>
|
||
<SectionLabel style={{ marginBottom: 12 }}>
|
||
Геотехнический риск
|
||
</SectionLabel>
|
||
<GeotechRiskBlock risk={data.geotech_risk} />
|
||
</div>
|
||
)}
|
||
|
||
{/* Geology */}
|
||
{data.geology !== undefined && (
|
||
<div>
|
||
<SectionLabel style={{ marginBottom: 12 }}>Геология</SectionLabel>
|
||
<GeologyBlock geology={data.geology} />
|
||
</div>
|
||
)}
|
||
|
||
{!hasAny && <EmptyState message="Данные о земле и геологии недоступны" />}
|
||
</div>
|
||
);
|
||
}
|