Begin migrate to leptos
This commit is contained in:
parent
1060e12513
commit
79daad993e
45 changed files with 3202 additions and 1975 deletions
30
src_old/components/timeline/TimelineCard.tsx
Normal file
30
src_old/components/timeline/TimelineCard.tsx
Normal file
|
@ -0,0 +1,30 @@
|
|||
import react, {Children, ReactNode} from 'react'
|
||||
import TimelineCardSummary from './TimelineCardSummary'
|
||||
import { FaCaretDown } from 'react-icons/fa'
|
||||
|
||||
type TimelineCardProps = {
|
||||
children: react.ReactElement<any, react.JSXElementConstructor<any>>[]
|
||||
}
|
||||
|
||||
function TimelineCard({ children } : TimelineCardProps) {
|
||||
let titles : ReactNode[] = []
|
||||
let childrens : ReactNode[] = []
|
||||
Children.forEach(children, (c) => {
|
||||
if (c.type === TimelineCardSummary) {
|
||||
titles.push(c)
|
||||
} else {
|
||||
childrens.push(c)
|
||||
}
|
||||
});
|
||||
return (
|
||||
<details>
|
||||
<summary>
|
||||
{titles}
|
||||
<i><FaCaretDown/></i>
|
||||
</summary>
|
||||
<div>{childrens}</div>
|
||||
</details>
|
||||
)
|
||||
}
|
||||
|
||||
export default TimelineCard
|
Loading…
Add table
Add a link
Reference in a new issue