"use client";
import { jsx } from 'react/jsx-runtime';
import { ErrorPlaceholder } from './error-placeholder.mjs';
import { usePluginOverrides } from '@btst/stack/context';
import { AI_CHAT_LOCALIZATION } from '../../localization/index.mjs';

function DefaultError({ error }) {
  const { localization } = usePluginOverrides("ai-chat", {
    localization: AI_CHAT_LOCALIZATION
  });
  const title = localization?.CHAT_GENERIC_ERROR_TITLE ?? AI_CHAT_LOCALIZATION.CHAT_GENERIC_ERROR_TITLE;
  const message = process.env.NODE_ENV === "production" ? localization?.CHAT_GENERIC_ERROR_MESSAGE ?? AI_CHAT_LOCALIZATION.CHAT_GENERIC_ERROR_MESSAGE : (error instanceof Error ? error.message : void 0) ?? localization?.CHAT_GENERIC_ERROR_MESSAGE ?? AI_CHAT_LOCALIZATION.CHAT_GENERIC_ERROR_MESSAGE;
  return /* @__PURE__ */ jsx(ErrorPlaceholder, { title, message });
}

export { DefaultError };
