Begin migrate to leptos

This commit is contained in:
Florian RICHER 2023-10-08 20:26:40 +02:00
parent 1060e12513
commit 79daad993e
45 changed files with 3202 additions and 1975 deletions

View file

@ -0,0 +1,31 @@
import './TimelineElement.scss'
import react, {Children, ReactNode} from 'react'
import TimelineLabel from './TimelineLabel'
type TimelineElementProps = {
children: react.ReactElement<any, react.JSXElementConstructor<any>>[]
}
function TimelineElement({ children } : TimelineElementProps) {
let labels : ReactNode[] = []
let cards : ReactNode[] = []
Children.forEach(children, (c) => {
if (c.type === TimelineLabel) {
labels.push(c)
} else {
cards.push(c)
}
});
return (
<li className='timeline-element'>
<div className='timeline-element__category'>
{ labels }
</div>
<div className='timeline-element__info'>
{ cards }
</div>
</li>
)
}
export default TimelineElement