- Added Custom Exams tab showing all exams from Generation page - Displays title, module badges, duration, and status - Added Create Exam button - Kept Exam Sessions tab for institutional sessions - Search filters across exams Made-with: Cursor
52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
import {
|
|
useLayoutEffect2
|
|
} from "./chunk-5ZB7HMJW.js";
|
|
import {
|
|
require_react
|
|
} from "./chunk-QCHXOAYK.js";
|
|
import {
|
|
__toESM
|
|
} from "./chunk-WOOG5QLI.js";
|
|
|
|
// node_modules/@radix-ui/react-use-size/dist/index.mjs
|
|
var React = __toESM(require_react(), 1);
|
|
function useSize(element) {
|
|
const [size, setSize] = React.useState(void 0);
|
|
useLayoutEffect2(() => {
|
|
if (element) {
|
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
if (!Array.isArray(entries)) {
|
|
return;
|
|
}
|
|
if (!entries.length) {
|
|
return;
|
|
}
|
|
const entry = entries[0];
|
|
let width;
|
|
let height;
|
|
if ("borderBoxSize" in entry) {
|
|
const borderSizeEntry = entry["borderBoxSize"];
|
|
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
width = borderSize["inlineSize"];
|
|
height = borderSize["blockSize"];
|
|
} else {
|
|
width = element.offsetWidth;
|
|
height = element.offsetHeight;
|
|
}
|
|
setSize({ width, height });
|
|
});
|
|
resizeObserver.observe(element, { box: "border-box" });
|
|
return () => resizeObserver.unobserve(element);
|
|
} else {
|
|
setSize(void 0);
|
|
}
|
|
}, [element]);
|
|
return size;
|
|
}
|
|
|
|
export {
|
|
useSize
|
|
};
|
|
//# sourceMappingURL=chunk-SBO4SQHK.js.map
|