reend-components 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -470,37 +470,43 @@ const Ft = s.forwardRef(({ className: t, ...r }, a) => /* @__PURE__ */ e(
470
470
  ));
471
471
  Ft.displayName = "CardFooter";
472
472
  const zt = s.forwardRef(
473
- ({ name: t, faction: r, rarity: a = 5, imageSrc: o, imageAlt: n, selected: i, className: c, ...d }, p) => /* @__PURE__ */ u(
474
- "div",
475
- {
476
- ref: p,
477
- className: l(
478
- "relative bg-surface-1 border border-border transition-all duration-300 w-[120px] sm:w-[140px] shrink-0 cursor-pointer",
479
- "hover:-translate-y-1 hover:shadow-[0_16px_48px_rgba(0,0,0,0.5)] hover:border-primary/20",
480
- i && "border-2 border-primary/40 bg-primary/[0.06]",
481
- c
482
- ),
483
- ...d,
484
- children: [
485
- /* @__PURE__ */ e("div", { className: "clip-corner-sm aspect-[3/4] bg-surface-2 overflow-hidden", children: o ? /* @__PURE__ */ e(
486
- "img",
487
- {
488
- src: o,
489
- alt: n ?? t,
490
- className: "w-full h-full object-cover"
491
- }
492
- ) : /* @__PURE__ */ e("div", { className: "w-full h-full flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-primary/20 text-4xl", children: "◆" }) }) }),
493
- /* @__PURE__ */ e("div", { className: "px-2 pt-1.5 pb-0", children: /* @__PURE__ */ u("span", { className: "text-[10px] text-primary tracking-wider", children: [
494
- "◆".repeat(a),
495
- "◇".repeat(6 - a)
496
- ] }) }),
497
- /* @__PURE__ */ u("div", { className: "px-2 pb-2", children: [
498
- /* @__PURE__ */ e("p", { className: "font-display text-[13px] font-semibold uppercase text-foreground leading-tight truncate", children: t }),
499
- r && /* @__PURE__ */ e("p", { className: "font-mono text-[10px] text-muted-foreground truncate", children: r })
500
- ] })
501
- ]
502
- }
503
- )
473
+ ({ name: t, faction: r, rarity: a = 5, imageSrc: o, imageAlt: n, selected: i, className: c, ...d }, p) => {
474
+ const [b, f] = s.useState(!1);
475
+ return /* @__PURE__ */ u(
476
+ "div",
477
+ {
478
+ ref: p,
479
+ className: l(
480
+ "relative bg-surface-1 border border-border transition-all duration-300 w-[120px] sm:w-[140px] shrink-0 cursor-pointer",
481
+ "hover:-translate-y-1 hover:shadow-[0_16px_48px_rgba(0,0,0,0.5)] hover:border-primary/20",
482
+ i && "border-2 border-primary/40 bg-primary/[0.06]",
483
+ c
484
+ ),
485
+ ...d,
486
+ children: [
487
+ /* @__PURE__ */ e("div", { className: "clip-corner-sm aspect-[3/4] bg-surface-2 overflow-hidden", children: o && !b ? /* @__PURE__ */ e(
488
+ "img",
489
+ {
490
+ src: o,
491
+ alt: n ?? t,
492
+ loading: "lazy",
493
+ decoding: "async",
494
+ onError: () => f(!0),
495
+ className: "w-full h-full object-cover"
496
+ }
497
+ ) : /* @__PURE__ */ e("div", { className: "w-full h-full flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-primary/20 text-4xl", children: "◆" }) }) }),
498
+ /* @__PURE__ */ e("div", { className: "px-2 pt-1.5 pb-0", children: /* @__PURE__ */ u("span", { className: "text-[10px] text-primary tracking-wider", children: [
499
+ "".repeat(a),
500
+ "◇".repeat(6 - a)
501
+ ] }) }),
502
+ /* @__PURE__ */ u("div", { className: "px-2 pb-2", children: [
503
+ /* @__PURE__ */ e("p", { className: "font-display text-[13px] font-semibold uppercase text-foreground leading-tight truncate", children: t }),
504
+ r && /* @__PURE__ */ e("p", { className: "font-mono text-[10px] text-muted-foreground truncate", children: r })
505
+ ] })
506
+ ]
507
+ }
508
+ );
509
+ }
504
510
  );
505
511
  zt.displayName = "OperatorCard";
506
512
  const Ht = s.forwardRef(
@@ -5992,6 +5998,7 @@ function Ae({
5992
5998
  initials: a,
5993
5999
  sizeClass: o
5994
6000
  }) {
6001
+ const [n, i] = s.useState(!1);
5995
6002
  return /* @__PURE__ */ e(
5996
6003
  "div",
5997
6004
  {
@@ -6003,13 +6010,14 @@ function Ae({
6003
6010
  style: {
6004
6011
  clipPath: "polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%)"
6005
6012
  },
6006
- children: t ? /* @__PURE__ */ e(
6013
+ children: t && !n ? /* @__PURE__ */ e(
6007
6014
  "img",
6008
6015
  {
6009
6016
  src: t,
6010
6017
  alt: r,
6011
6018
  loading: "lazy",
6012
6019
  decoding: "async",
6020
+ onError: () => i(!0),
6013
6021
  className: "w-full h-full object-cover"
6014
6022
  }
6015
6023
  ) : /* @__PURE__ */ e("span", { children: a ?? r.slice(0, 2) })