import { Link, useNavigate } from "@tanstack/react-router"; import { useEffect, useState } from "react"; import { pad, search } from "../data"; import { Find } from "../Find"; export function Chapters() { const [query, setQuery] = useState(""); const navigate = useNavigate(); const found = search(query); useEffect(() => { document.title = "Components · Ely"; }, []); const first = () => found[0] && navigate({ to: "/components/$page/$story/", params: { page: found[0].slug, story: found[0].stories[0].slug } }); return (

Components.

{found.length === 0 &&

Nothing matches “{query}”.

}
    {found.map((c) => (
  1. {pad(c.number)} {c.title} {c.stories.map((s) => ( {s.name} ))}
  2. ))}
); }