2
0

chore(lp): 📦️ Import existing Landing page

This commit is contained in:
Baptiste Arnaud
2022-02-09 18:40:40 +01:00
parent 65b30bfc48
commit 36be3577e1
136 changed files with 14867 additions and 20 deletions

View File

@ -0,0 +1,23 @@
import { Stack, StackProps } from '@chakra-ui/react'
import * as React from 'react'
import { ListItemProps } from './ListItem'
export const List = (props: StackProps) => {
const { children, ...stackProps } = props
const items = React.useMemo(
() =>
React.Children.toArray(children)
.filter<React.ReactElement<ListItemProps>>(React.isValidElement)
.map((item, index, array) =>
index + 1 === array.length
? React.cloneElement(item, { isLastItem: true })
: item
),
[children]
)
return (
<Stack as="ul" {...stackProps}>
{items}
</Stack>
)
}