'use strict';

const jsxRuntime = require('react/jsx-runtime');

function ErrorFallback({ error }) {
  const errorMessage = error == null ? void 0 : error instanceof Error ? error.message : String(error);
  const errorStack = error instanceof Error ? error.stack : void 0;
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 border border-red-500 bg-red-100 text-red-700 rounded flex-grow w-full", children: [
    /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-bold mb-2", children: "Component Error" }),
    /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
      "Error: ",
      errorMessage || "Unknown error"
    ] }),
    /* @__PURE__ */ jsxRuntime.jsxs("details", { className: "mt-2", children: [
      /* @__PURE__ */ jsxRuntime.jsx("summary", { className: "cursor-pointer", children: "Stack trace" }),
      /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "mt-2 text-xs whitespace-pre-wrap", children: errorStack })
    ] })
  ] });
}

exports.ErrorFallback = ErrorFallback;
