doorgan/routes/[page].ts/index.tsx

19 lines
539 B
TypeScript
Raw Permalink Normal View History

2024-10-21 02:48:23 +00:00
import {useContext} from "preact/hooks";
import { ConfigContext } from "#/routes/_app.tsx";
import type { PageProps } from "$fresh/server.ts";
export default function SubPage(props: PageProps) {
const config = useContext(ConfigContext);
const page = config.pages?.find((page) => page.title === props.params.page);
if(!page) {
return <div>page not found</div>
}
return (
<div class="px-4 py-8 mx-auto">
<div class="max-w-screen-md mx-auto flex flex-col items-center justify-center">
</div>
</div>
);
}