import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { CardIcon } from "../CardIcon";
import * as styles from "./styles";
import { useResponsiveBreakpoints } from "~/hooks/useResponsiveBreakpoints";
import { useLeadCapture } from "~/sdks/LeadCapture/context";
const cardTypes = {
    neighborhoodIntel: [
        "neighborhoodContext",
        "locationInsights",
        "climateRisk",
        "communityPortrait",
    ],
    marketTrendsReport: [
        "neighborhoodMarketTrends",
        "dailyUpdates",
        "fiveYearHistoricalView",
        "easyToReadFormat",
        "actionableInsights",
    ],
};
export function Card({ type }) {
    const { t } = useTranslation("leadCapture");
    const { country } = useLeadCapture();
    const breakpoints = useResponsiveBreakpoints();
    const isMobile = useMemo(() => !breakpoints.md, [breakpoints.md]);
    const items = useMemo(() => {
        var _a;
        if (country !== "CAN" && type === "neighborhoodIntel") {
            return (_a = cardTypes.neighborhoodIntel) === null || _a === void 0 ? void 0 : _a.concat("localMarketOverview");
        }
        return cardTypes[type];
    }, [cardTypes, type]);
    return (React.createElement("div", { className: styles.card, "data-testid": `card-${type}`, "data-size": !isMobile && country === "CAN" && "full" },
        React.createElement("h4", { className: styles.title }, t(`cards.${type}.title`)),
        React.createElement("div", { className: styles.items }, items === null || items === void 0 ? void 0 : items.map((item) => (React.createElement("div", { key: item, className: styles.item },
            React.createElement(CardIcon, { card: item, className: styles.icon }),
            React.createElement("p", { className: styles.name },
                t(`cards.${item}.title`),
                !isMobile && country === "CAN" && (React.createElement("span", { className: styles.description, "data-testid": `card-description-${item}` }, t(`cards.${item}.description`))))))))));
}
//# sourceMappingURL=index.js.map