import React from "react";
import { XIcon } from "@phosphor-icons/react";
import { useTranslation } from "react-i18next";
import { useRootElement } from "../context";
import * as styles from "./styles";
export function Header({ hideCloseButton = false, }) {
    const { t } = useTranslation("localContent");
    const { onToggleIsOpen } = useRootElement();
    return (React.createElement("div", { className: styles.container },
        React.createElement("h2", { "data-testid": "commute-calculator-title", className: styles.title }, t("commute.cta")),
        !hideCloseButton && (React.createElement("button", { onClick: onToggleIsOpen, "data-testid": "commute-calculator-close-button" },
            React.createElement(XIcon, { weight: "bold", className: styles.icon })))));
}
//# sourceMappingURL=index.js.map