Files
klz-cables.com/.pnpm-store/v10/files/6d/877ddb8aab3c3f222f34318d4e7032c79eabb5f651b568da0336df002e071a39fef9f9984de9cd55d8312f46ba31a63e82ef3f90ee5a2fe5c0b267631f8578
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

77 lines
1.7 KiB
Plaintext

'use client';
import { c as _c } from "react/compiler-runtime";
import { useEffect, useState } from 'react';
export const useResize = element => {
const $ = _c(5);
const [size, setSize] = useState();
let t0;
let t1;
if ($[0] !== element) {
t0 = () => {
let observer;
if (element) {
observer = new ResizeObserver(entries => {
entries.forEach(entry => {
const {
contentBoxSize,
contentRect
} = entry;
let newWidth = 0;
let newHeight = 0;
if (contentBoxSize) {
const newSize = Array.isArray(contentBoxSize) ? contentBoxSize[0] : contentBoxSize;
if (newSize) {
const {
blockSize,
inlineSize
} = newSize;
newWidth = inlineSize;
newHeight = blockSize;
}
} else {
if (contentRect) {
const {
height,
width
} = contentRect;
newWidth = width;
newHeight = height;
}
}
setSize({
height: newHeight,
width: newWidth
});
});
});
observer.observe(element);
}
return () => {
if (observer) {
observer.unobserve(element);
}
};
};
t1 = [element];
$[0] = element;
$[1] = t0;
$[2] = t1;
} else {
t0 = $[1];
t1 = $[2];
}
useEffect(t0, t1);
let t2;
if ($[3] !== size) {
t2 = {
size
};
$[3] = size;
$[4] = t2;
} else {
t2 = $[4];
}
return t2;
};
//# sourceMappingURL=useResize.js.map