import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import * as styles from "../styles";
import { useNeighborhoodMarketTrends } from "~/sdks/NeighborhoodMarketTrends/context";
export const MedianConstructionYear = () => {
    const { t } = useTranslation("neighborhoodMarketTrends");
    const { marketActivity } = useNeighborhoodMarketTrends();
    const medianConstructionYear = useMemo(() => {
        var _a, _b, _c, _d;
        return (_d = (_c = (_b = (_a = marketActivity === null || marketActivity === void 0 ? void 0 : marketActivity.market_activity_by_property_type) === null || _a === void 0 ? void 0 : _a.all_residential_properties.intervals["12m"]) === null || _b === void 0 ? void 0 : _b.market_activity) === null || _c === void 0 ? void 0 : _c.stats_over_period) === null || _d === void 0 ? void 0 : _d.median_construction_year_sold_homes;
    }, [marketActivity]);
    if (!medianConstructionYear) {
        return null;
    }
    return (React.createElement("div", { className: styles.smallContainer },
        React.createElement("h3", { className: styles.title },
            t("graphs.medianConstructionYear.title"),
            React.createElement("span", { className: styles.titleBold }, medianConstructionYear),
            ".")));
};
//# sourceMappingURL=index.js.map