Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Schniz/cmd-ts. 💻 A type-driven command line argument parser cmd-ts.now.sh
Something went wrong. Try again.
12345678910111213141516171819202122import { Size } from './options';import { Box } from './Box';import React from 'react';
export function Stack(props: { spacing: Size; children: React.ReactNode | React.ReactNodeArray;}) { const numberOfComponents = React.Children.count(props.children); const components = React.Children.map(props.children, (child, index) => { const padding: Size = numberOfComponents === index + 1 ? 'none' : props.spacing; return ( <Box key={index} paddingBottom={padding}> {child} </Box> ); });
return <>{components}</>;}