import { a as IconSize } from "./constants2.js";
import { t as Icon_default } from "./Icon.js";
import { t as CheckFill_default } from "./CheckFill.js";
import { t as useIsMobileBreakpoint } from "./useIsMobileBreakpoint.js";
import { t as Close_default } from "./Close.js";
import classNames from "classnames";
import { jsx, jsxs } from "react/jsx-runtime";
import styles from "./components/Toast/styles.module.scss";
var Toast = ({ testId, title, message, onClose }) => {
	const isMobile = useIsMobileBreakpoint();
	const handleClose = () => {
		if (onClose) onClose();
	};
	return /* @__PURE__ */ jsxs("output", {
		className: styles["toast"],
		"data-testid": testId,
		children: [
			/* @__PURE__ */ jsx(Icon_default, {
				size: isMobile ? IconSize.XSmall : IconSize.Small,
				svgIcon: CheckFill_default,
				className: classNames(styles["toast__icon"], styles["toast__icon--check"])
			}),
			/* @__PURE__ */ jsxs("div", {
				className: styles["toast__text-container"],
				children: [/* @__PURE__ */ jsx("span", {
					className: styles["toast__title"],
					children: title
				}), message && /* @__PURE__ */ jsx("span", {
					className: styles["toast__description"],
					children: message
				})]
			}),
			/* @__PURE__ */ jsx(Close_default, {
				onClick: handleClose,
				color: "black",
				className: classNames(styles["toast__icon"], styles["toast__icon--close"]),
				testId: `${testId}-close`
			})
		]
	});
};
var Toast_default = Toast;
export { Toast_default as t };

//# sourceMappingURL=Toast.js.map