Resizable Vertical Split Pane Component
Modern applications, especially those in data visualization, IDEs, or dashboards, often require flexible layouts where users can dynamically adjust the size of different content areas. A common pattern for this is a 'Split Pane' component. This problem focuses on building a robust and interactive vertical split pane, allowing users to intuitively resize two content areas (top and bottom) by dragging a divider.
Your task is to implement a React functional component named SplitPane that renders two distinct content areas, topContent and bottomContent, separated by a draggable horizontal divider. The user should be able to drag this divider vertically to resize the top and bottom panes.
SplitPane Component: Create a SplitPane React component that accepts topContent and bottomContent as React.ReactNode props.topContent pane should adjust, and the bottomContent pane should automatically fill the remaining available height within the SplitPane container.SplitPane should initially divide the available vertical space equally (50/50 split) between the top and bottom panes.ns-resize when hovered over.50px to prevent them from collapsing completely.SplitPane component renders topContent and bottomContent props correctly.ns-resize.50px during resizing.Constraints
MouseEvent, window.addEventListener).SplitPane component should occupy 100% width and a predefined height of its parent container. Assume the parent container provides adequate height for the split pane to function.Loading editor...