import { n as AnalyticsId, s as LanguageLocales } from "../../constants2.js";
import { n as useLanguage } from "../../useLanguage.js";
import classNames from "classnames";
import { jsx, jsxs } from "react/jsx-runtime";
import styles from "./styles.module.scss";
var HN_Designsystem_ArticleTeaser_en_GB_default = {
	expandButtonClose: "Show more",
	expandButtonOpen: "Show less"
};
var HN_Designsystem_ArticleTeaser_nb_NO_default = {
	expandButtonClose: "Vis mer",
	expandButtonOpen: "Vis mindre"
};
const getResources = (language) => {
	switch (language) {
		case LanguageLocales.ENGLISH: return HN_Designsystem_ArticleTeaser_en_GB_default;
		case LanguageLocales.NORWEGIAN:
		default: return HN_Designsystem_ArticleTeaser_nb_NO_default;
	}
};
var ArticleTeaser = (props) => {
	const { onExpand, children, contentId, expanded, htmlMarkup = "div", resources, testId } = props;
	const WrapperTag = htmlMarkup;
	const { language } = useLanguage(LanguageLocales.NORWEGIAN);
	const mergedResources = {
		...getResources(language),
		...resources
	};
	return /* @__PURE__ */ jsxs(WrapperTag, {
		className: classNames(styles.articleteaser),
		"data-testid": testId,
		"data-analyticsid": AnalyticsId.ArticleTeaser,
		children: [/* @__PURE__ */ jsx("div", {
			className: classNames(styles["articleteaser__content"], { [styles["articleteaser__content--collapsed"]]: !expanded }),
			style: { maxHeight: expanded ? "none" : props.heightCollapsed },
			children
		}), /* @__PURE__ */ jsx("button", {
			type: "button",
			className: classNames(styles["articleteaser__button"], { [styles["articleteaser__button--expanded"]]: expanded }),
			onClick: onExpand,
			"aria-expanded": expanded,
			"aria-controls": contentId,
			children: expanded ? mergedResources.expandButtonOpen : mergedResources.expandButtonClose
		})]
	});
};
var ArticleTeaser_default = ArticleTeaser;
export { ArticleTeaser_default as default };

//# sourceMappingURL=index.js.map