import { Timeline } from "@chakra-ui/react" import { Children, isValidElement } from "react" export const Steps = (props: React.PropsWithChildren<{}>) => { return ( {Children.map(props.children, (child, index) => { return ( {index + 1} :is(h3, h4, h5)": { marginTop: "0", "& + p": { marginBottom: "0" }, "& + p + p": { marginBottom: "0" }, }, }} > {isValidElement(child) ? child.props.children : child} ) })} ) }