import { useEffect as e } from "react";
import { toast as t } from "sonner";
//#region src/components/feedback/Snackbar.tsx
var n = ({ message: n, variant: r = "info", show: i = !0, icon: a, duration: o = 4e3, position: s = "bottom-center", id: c, onDismiss: l }) => (e(() => {
	if (!n || !i) {
		c && !i && (t.dismiss(c), l?.());
		return;
	}
	let e = {
		duration: o,
		position: s,
		id: c,
		...a && { icon: a }
	};
	switch (r) {
		case "success":
			t.success(n, e);
			break;
		case "error":
			t.error(n, e);
			break;
		case "warning":
			t.warning(n, e);
			break;
		case "loading":
			t.loading(n, e);
			break;
		default:
			t(n, e);
			break;
	}
}, [
	n,
	i,
	r,
	a,
	o,
	s,
	c,
	l
]), null);
//#endregion
export { n as default };
