UNPKG

@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.

24 lines (21 loc) 809 B
'use client'; import React from 'react'; import { SplitPane } from '../Pane/SplitPane.mjs'; import { SplitResizer } from '../Resizer/SplitResizer.mjs'; function SplitDynamic({ panes, filter }) { const visiblePanes = filter ? panes.filter(filter) : panes; const elements = []; visiblePanes.forEach((pane, index) => { const { id, content, resizerProps, ...paneProps } = pane; elements.push( /* @__PURE__ */ React.createElement(SplitPane, { key: id, ...paneProps }, content) ); if (index < visiblePanes.length - 1) { elements.push(/* @__PURE__ */ React.createElement(SplitResizer, { key: `resizer-after-${id}`, ...resizerProps })); } }); return elements; } SplitDynamic.displayName = "Split.Dynamic"; export { SplitDynamic }; //# sourceMappingURL=SplitDynamic.mjs.map