@gfazioli/mantine-split-pane
Version:
A Mantine 9 React component for resizable split pane layouts with 7 resizer variants, context-based prop inheritance, responsive orientation, and dynamic pane generation.
18 lines (15 loc) • 524 B
JavaScript
'use client';
import { useMatches } from '@mantine/core';
function useResponsiveValue(value, defaultValue) {
const isBreakpointMap = value !== null && value !== void 0 && typeof value === "object" && !Array.isArray(value);
const matched = useMatches(isBreakpointMap ? value : {});
if (value === void 0 || value === null) {
return defaultValue;
}
if (isBreakpointMap) {
return matched ?? defaultValue;
}
return value;
}
export { useResponsiveValue };
//# sourceMappingURL=use-responsive-value.mjs.map