import { cn as e } from "../../../lib/utils.js";
import { Alert as t, AlertDescription as n } from "../atoms/alert.js";
import { Card as r, CardContent as i, CardDescription as a, CardFooter as o, CardHeader as s, CardTitle as c } from "../atoms/card.js";
import { jsx as l, jsxs as u } from "react/jsx-runtime";
import { AlertTriangle as d } from "lucide-react";
//#region lib/components/ui/molecules/error-state.tsx
function f({ title: f = "Something went wrong", description: p = "We've been notified of this error and will investigate.", errorMessage: m, errorStack: h, showDeveloperDetails: g = !1, children: _, className: v, ...y }) {
	let b = !!(h && g);
	return /* @__PURE__ */ l("div", {
		className: e("flex h-full items-center justify-center p-4", v),
		...y,
		children: /* @__PURE__ */ u(r, {
			className: "w-full max-w-md 2xl:max-w-xl",
			role: "alert",
			children: [
				/* @__PURE__ */ u(s, {
					className: "text-center",
					children: [
						/* @__PURE__ */ l("div", {
							className: "mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/20",
							children: /* @__PURE__ */ l(d, { className: "h-6 w-6 text-red-600 dark:text-red-400" })
						}),
						/* @__PURE__ */ l(c, {
							className: "text-xl",
							children: f
						}),
						p && /* @__PURE__ */ l(a, { children: p })
					]
				}),
				(m || h) && /* @__PURE__ */ u(i, {
					className: "space-y-4",
					children: [m && /* @__PURE__ */ u(t, {
						variant: "destructive",
						children: [/* @__PURE__ */ l(d, { className: "h-4 w-4" }), /* @__PURE__ */ l(n, {
							className: "whitespace-pre-wrap break-words font-mono text-sm",
							children: m
						})]
					}), b && /* @__PURE__ */ u("details", {
						className: "text-muted-foreground text-xs",
						children: [/* @__PURE__ */ l("summary", {
							className: "cursor-pointer hover:text-foreground",
							children: "Developer Details"
						}), /* @__PURE__ */ l("pre", {
							className: "mt-2 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 text-xs",
							children: h
						})]
					})]
				}),
				_ && /* @__PURE__ */ l(o, {
					className: "flex gap-2",
					children: _
				})
			]
		})
	});
}
//#endregion
export { f as ErrorState };
