"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { useT } from "@open-mercato/shared/lib/i18n/context";
import { Alert, AlertDescription, AlertTitle } from "./alert.js";
function ErrorNotice({ title, message, action }) {
  const t = useT();
  const resolvedTitle = title ?? t("ui.errors.defaultTitle", "Something went wrong");
  const resolvedMessage = message ?? t("ui.errors.defaultMessage", "Unable to load data. Please try again.");
  return /* @__PURE__ */ jsxs(Alert, { variant: "destructive", children: [
    /* @__PURE__ */ jsx(AlertTitle, { children: resolvedTitle }),
    /* @__PURE__ */ jsx(AlertDescription, { children: resolvedMessage }),
    action ? /* @__PURE__ */ jsx("div", { className: "mt-2", children: action }) : null
  ] });
}
export {
  ErrorNotice
};
//# sourceMappingURL=ErrorNotice.js.map
