import React from "react";
import { useTranslation } from "react-i18next";
import { TrophyIcon, MedalIcon } from "@phosphor-icons/react";
import * as styles from "./styles";
import { allowedValueDrivers, allowedDriverLowQualifiers, } from "~/sdks/NeighborhoodPropertyValueDrivers/constants";
import { ValueDriverIcon } from "~/components/ValueDriverIcon";
const badges = {
    high: {
        tag: "high",
        icon: TrophyIcon,
    },
    med: {
        tag: "high",
        icon: TrophyIcon,
    },
    low: {
        tag: "low",
        icon: MedalIcon,
    },
};
export function Card({ driver, locationType }) {
    const { t } = useTranslation(["neighborhoodPropertyValueDrivers", "common"]);
    const BadgeIcon = badges[driver.value_qualifier].icon;
    if (!allowedValueDrivers.includes(driver.name)) {
        return null;
    }
    return (React.createElement("div", { key: driver.name, className: styles.card },
        React.createElement("div", { className: styles.title },
            React.createElement("div", { className: styles.badge },
                React.createElement(BadgeIcon, { className: `${styles.icon} ${styles.badgeText}` }),
                React.createElement("p", { className: styles.badgeText }, t(`valueDrivers.${driver.name}.tag.${badges[driver.value_qualifier].tag}`))),
            React.createElement("div", { className: styles.titleContainer },
                React.createElement(ValueDriverIcon, { driver: driver.name, className: styles.icon }),
                React.createElement("p", { className: styles.text }, t(`common:valueDrivers.${driver.name}`)))),
        React.createElement("p", { className: styles.qualifiers },
            driver.value_qualifier !== "low" &&
                allowedValueDrivers.includes(driver.name) &&
                t(`valueDrivers.${driver.name}.qualifier.high`, "", {
                    locationType,
                }),
            driver.value_qualifier === "low" &&
                allowedDriverLowQualifiers.includes(driver.name) &&
                t(`valueDrivers.${driver.name}.qualifier.low`, "", { locationType }))));
}
//# sourceMappingURL=index.js.map