@burdenoff/website-sdk 2026.716.2 → 2026.719.1

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.
package/dist/index.mjs CHANGED
@@ -3917,6 +3917,10 @@ function ResourceLinks({
3917
3917
  function normalizeSearch(value) {
3918
3918
  return value.toLowerCase().trim();
3919
3919
  }
3920
+ function resolveWebsiteProductLogo(product) {
3921
+ if (product.logoUrl) return product.logoUrl;
3922
+ return `${product.websiteUrl.replace(/\/+$/, "")}/logo-icon.png`;
3923
+ }
3920
3924
  function filterProducts(products, query) {
3921
3925
  const normalized = normalizeSearch(query);
3922
3926
  if (!normalized) return products;
@@ -3931,6 +3935,9 @@ function WebsiteSwitcher({
3931
3935
  }) {
3932
3936
  const [open, setOpen] = useState(false);
3933
3937
  const [query, setQuery] = useState("");
3938
+ const [failedLogos, setFailedLogos] = useState(
3939
+ () => /* @__PURE__ */ new Set()
3940
+ );
3934
3941
  const filtered = useMemo(
3935
3942
  () => filterProducts(products, query),
3936
3943
  [products, query]
@@ -4009,15 +4016,21 @@ function WebsiteSwitcher({
4009
4016
  "text-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"
4010
4017
  ),
4011
4018
  children: [
4012
- product.logoUrl ? /* @__PURE__ */ jsx(
4019
+ failedLogos.has(product.slug) ? /* @__PURE__ */ jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded bg-primary/10 text-[10px] font-bold text-primary", children: product.name.charAt(0) }) : /* @__PURE__ */ jsx(
4013
4020
  "img",
4014
4021
  {
4015
- src: product.logoUrl,
4022
+ src: resolveWebsiteProductLogo(product),
4016
4023
  alt: "",
4017
4024
  "aria-hidden": "true",
4018
- className: "h-5 w-5 shrink-0 rounded object-contain"
4025
+ loading: "lazy",
4026
+ className: "h-5 w-5 shrink-0 rounded object-contain",
4027
+ onError: () => setFailedLogos((prev) => {
4028
+ const next = new Set(prev);
4029
+ next.add(product.slug);
4030
+ return next;
4031
+ })
4019
4032
  }
4020
- ) : /* @__PURE__ */ jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded bg-primary/10 text-[10px] font-bold text-primary", children: product.name.charAt(0) }),
4033
+ ),
4021
4034
  /* @__PURE__ */ jsx("span", { className: "truncate", children: product.name })
4022
4035
  ]
4023
4036
  }