import { HeadingWithAnchorLink, Markdown } from '../components/markdown' import { ScrollToTop } from '../components/Scroll' import { Fragment, useEffect } from 'react' import { useLocation } from 'react-router-dom' import { HashLink as Link } from 'react-router-hash-link' import mecanisms from '../../docs/mecanisms.yaml' import { capitalise0 } from 'publicodes' import { Header } from '../components/Header' const sortedMecanisms = Object.entries(mecanisms).sort(([a], [b]) => a.localeCompare(b) ) export default function Landing() { const { pathname } = useLocation() useEffect(() => { const css = document.createElement('style') css.type = 'text/css' css.innerHTML = ` #js { animation: appear 0.5s; opacity: 1; } #loading { display: none !important; }` document.body.appendChild(css) }) return ( <>

Mécanismes existants

{sortedMecanisms.map(([name, data]) => ( Retour à la liste ))} ) } type ExplanationProp = { exemples: { base: string } description: string name: string } function Explanation({ name, description, exemples }: ExplanationProp) { return ( <> {!!name && (
{name}
)} {exemples && ( <> {Object.entries(exemples).map(([name, exemple]) => (

{name === 'base' ? 'Exemple' : capitalise0(name)}

))}{' '} )} ) }