export const routes: RouteDefinition[] = [ { path: '/:folder', component: Emails, }]const App: Component = () => { const folderp = useParams().folder const [folders, setFolders] = createSignal(availableFolders); const [folder, setFolder] = createSignal("inbox"); const [emails, setEmails] = createSignal(allEmails); const folderEmails = () => emails().filter(email => { return email.folders.indexOf(folder()) > -1 }); console.log(folderp) const Routes = useRoutes(routes); const navigate = useNavigate(); navigate(folder()); return ( <div> <header> <Toolbar></Toolbar> </header> <aside> <ul> <For each={folders()}> {(folder, i) => ( <li> <A href={`/${folder.id}`}>{folder.name}</A> </li> )} </For> </ul> </aside> <main> <Routes /> {/* <Emails emails={folderEmails()} /> */} </main> </div> );};
undefined