import React from "react"; interface LayoutElementCoreProps extends React.HTMLAttributes { sizes?: number[]; children: React.ReactNode | React.ReactNode[]; } interface LayoutElementProps extends LayoutElementCoreProps { type: "row" | "column"; dimension: "width" | "height"; } function LayoutElement({ children, type, dimension, sizes, ...otherProps }: LayoutElementProps) { const nonNullSizes = sizes ?? []; const totalSize = React.Children.map(children, ((_, i) => nonNullSizes[i] ?? 1))?.reduce((l, r) => l + r, 0) ?? 0; const unit = totalSize ? 100 / totalSize : 0; return (
{React.Children.map(children, ((child, i) => (
{child}
)))}
); } export const Row = (props: LayoutElementCoreProps) => ; export const Column = (props: LayoutElementCoreProps) => ; export interface LayoutProps extends React.HTMLAttributes { children: React.ReactNode | React.ReactNode[]; } export function Layout({ children, ...otherProps }: LayoutProps) { return
{children}
; }