"use client"; import { useEstimateHouseAnalytics, useEstimateSellTimeSensitivity } from "@/lib/trade-in-api"; import { PriceHistoryChart } from "./PriceHistoryChart"; import { HouseAnalyticsKpiRow } from "./HouseAnalyticsKpiRow"; import { RecentSoldList } from "./RecentSoldList"; import { SellTimeSensitivity } from "./SellTimeSensitivity"; type Props = { estimateId: string }; export function HouseAnalyticsSection({ estimateId }: Props) { const { data, isPending, isError } = useEstimateHouseAnalytics(estimateId); const sellTime = useEstimateSellTimeSensitivity(estimateId); if (isPending || isError || !data) return null; if (data.kpi.total_lots === 0) return null; return (

Аналитика дома

{data.kpi.total_lots} объявлений {data.radius_m > 0 ? ` · в радиусе ${data.radius_m}м` : " · в этом доме"}
{sellTime.data && } {data.price_history.length >= 2 && ( )} {data.recent_sold.length > 0 && ( )}
); }