import FullScreenErrorBoundaryImageSrc from './assets/full-screen-error-boundary-img.png';
import { transI18n } from '../../i18n';
import { FcrIcon } from '../icon';
import { FcrIconType } from '../icon/type';
import { isElectron } from 'agora-foundation/lib/utilities/env';
import './index.css';
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
export var FcrCrashFallback = function FcrCrashFallback(_ref) {
  var handleFallback = _ref.handleFallback;
  return /*#__PURE__*/_jsx("div", {
    className: "fcr-pc-full-screen-error",
    children: /*#__PURE__*/_jsxs("div", {
      className: "fcr-pc-full-screen-error-content",
      children: [/*#__PURE__*/_jsx("img", {
        src: FullScreenErrorBoundaryImageSrc,
        className: "fcr-pc-full-screen-error-content-img"
      }), /*#__PURE__*/_jsx("div", {
        className: "fcr-pc-full-screen-error-content-title",
        children: transI18n('fmt_failure_popup_label_crash')
      }), /*#__PURE__*/_jsx("div", {
        className: "fcr-pc-full-screen-error-content-desc",
        children: transI18n('fmt_failure_popup_label_crash_tips')
      }), /*#__PURE__*/_jsx("div", {
        className: "fcr-pc-full-screen-close-btn",
        onClick: handleFallback,
        children: isElectron() ? /*#__PURE__*/_jsx("span", {
          children: transI18n('fmt_failure_popup_button_close_app')
        }) : /*#__PURE__*/_jsxs(_Fragment, {
          children: [/*#__PURE__*/_jsx(FcrIcon, {
            type: FcrIconType.FCR_RESET,
            size: 30,
            colors: {
              iconPrimary: 'var(--fcr_ui_scene_inverse)'
            }
          }), /*#__PURE__*/_jsx("span", {
            children: transI18n('fmt_failure_popup_button_refresh')
          })]
        })
      })]
    })
  });
};