'use strict';
import { c } from 'react/compiler-runtime';
import { jsxs, jsx } from 'react/jsx-runtime';
import { useEffect } from 'react';
import { logErrorRaw } from '../../../../fd-toolbox/logging/loggers.js';
import { Button } from '../../../fd-component-toolbox/button/Button.js';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", {
  value,
  configurable: true
});
function ErrorFallbackComponent(t0) {
  const $ = c(5);
  const {
    error,
    reset
  } = t0;
  let t1;
  let t2;
  if ($[0] !== error) {
    t1 = () => {
      logErrorRaw(error);
    };
    t2 = [error];
    $[0] = error;
    $[1] = t1;
    $[2] = t2;
  } else {
    t1 = $[1];
    t2 = $[2];
  }
  useEffect(t1, t2);
  let t3;
  if ($[3] !== reset) {
    t3 = jsxs("div", {
      className: "flex h-full flex-col items-center justify-center gap-3",
      children: [jsx("h2", {
        className: "text-destructive text-2xl",
        children: "Something went wrong!"
      }), jsx(Button, {
        variant: "destructive",
        onClick: () => reset(),
        children: "Try again"
      })]
    });
    $[3] = reset;
    $[4] = t3;
  } else {
    t3 = $[4];
  }
  return t3;
}
__name(ErrorFallbackComponent, "ErrorFallbackComponent");

export { ErrorFallbackComponent };
