import clsx from "clsx" import React, { Children } from "react" import { useComputedHeight } from "../../hooks/use-computed-height" type TwoSplitPaneProps = { className?: string threeCols?: boolean children?: React.ReactNode } const TwoSplitPane: React.FC = ({ threeCols, className, children, }) => { const childrenCount = Children.count(children) const { ref, height } = useComputedHeight(32) const heightClass = height ? { gridTemplateRows: `${height}px`, } : undefined if (childrenCount > 2) { throw new Error("TwoSplitPane can only have two or less children") } return (
{Children.map(children, (child, i) => { return (
{child}
) })}
) } export default TwoSplitPane