import { FunctionComponent } from 'react' import { ParsedUrlQuery } from 'querystring' const FileListing: FunctionComponent<{ query: ParsedUrlQuery }> = ({ query }) => { const { path } = query // Multiple levels of path if (Array.isArray(path)) { return ( <> {path.map((p: any, i: number) => (
{p}
))} ) } // Only one level of path if (path) { return
{path}
} return
index page
} export default FileListing