import './TimelineElement.scss' import react, {Children, ReactNode} from 'react' type TimelineElementProps = { children: react.ReactElement>[] } function TimelineElement({ children } : TimelineElementProps) { let labels : ReactNode[] = [] let cards : ReactNode[] = [] Children.forEach(children, (c) => { if (c.type.name === "TimelineLabel") { labels.push(c) } else { cards.push(c) } }); return (
  • { labels }
    { cards }
  • ) } export default TimelineElement