import type { Metadata, ResolvingMetadata } from 'next'; import Image from 'next/image'; import DownloadTTY from './download_tty'; import Content from './content'; import * as style from './page.css'; import download_image_dark from './download_dark.svg'; import download_image_light from './download_light.svg'; type SearchParams = { [key: string]: string | string[] | undefined }; type Props = { params: { file: string }, searchParams: SearchParams, }; function get_path(file: string[]) { return file.join("/"); } function get_root(search_params: SearchParams) { return search_params['root'] ?? 'raw.monodon.me'; } export async function generateMetadata( { params, searchParams }: Props, parent: ResolvingMetadata, ): Promise { return { title: `${get_path(params.file)} | ${get_root(searchParams)}`, }; } export default async function Page({ params, searchParams }: Props) { const path = get_path(params.file); const root = `https://${get_root(searchParams)}/`; const full = `${root}${path}`; const download_ttys = [ `curl -O ${root}${path}`, `wget ${root}${path}`, ]; return (

{root}

{path}

{download_ttys.map((text, index) => )}
); }