"use client";
// "КОЭФФИЦИЕНТ ЛОКАЦИИ" right-side drawer for the /trade-in/v2 "МЕРА Оценка"
// design port. Faithful markup port of the design drawer (МЕРА Оценка.dc.html,
// lines 618-660): scrim + 452px right slider that slides in via translateX, a
// big location coefficient, intro, base×coef formula, the factors that raise /
// lower price, and a geo-source footer. Static markup, data from fixtures.
// Open/close is driven entirely by props (no internal state, no fetch).
import { tokens } from "./tokens";
import type { LocationFactor } from "./types";
import { locationFactors } from "./fixtures";
interface LocationDrawerProps {
open: boolean;
onClose: () => void;
}
function FactorRow({
factor,
variant,
}: {
factor: LocationFactor;
variant: "pos" | "neg";
}) {
const isPos = variant === "pos";
return (
{isPos ? "+" : "−"}
{factor.label}
{factor.delta}
);
}
export function LocationDrawer({ open, onClose }: LocationDrawerProps) {
return (
<>
{/* scrim */}
{/* drawer */}
{/* left accent rail */}
{/* corner brackets */}
{/* header */}
ПОЯСНЕНИЕ К РАСЧЁТУ
КОЭФФИЦИЕНТ ЛОКАЦИИ
✕
{/* big coefficient */}
{locationFactors.coef}
множитель к базовой
цене по городу
{/* intro */}
Показывает, как адрес корректирует стоимость относительно медианы по
Екатеринбургу. 1.00 — средний
уровень. 0.87 означает, что
локация снижает цену примерно на{" "}
13% из-за баланса факторов ниже.
{/* formula */}
{locationFactors.formula.base}
×
{locationFactors.formula.coef}
=
{locationFactors.formula.result}
{/* positives */}
ЧТО ПОВЫШАЕТ ЦЕНУ
{locationFactors.positives.map((f, i) => (
))}
{/* negatives */}
ЧТО СНИЖАЕТ ЦЕНУ
{locationFactors.negatives.map((f, i) => (
))}
{/* footer source */}
{locationFactors.footer}
>
);
}