mirror of
https://github.com/Nezumi-2711/onedrive-vercel-index.git
synced 2026-09-22 13:38:45 +00:00
26 lines
522 B
TypeScript
26 lines
522 B
TypeScript
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) => (
|
|
<div key="i">{p}</div>
|
|
))}
|
|
</>
|
|
)
|
|
}
|
|
|
|
// Only one level of path
|
|
if (path) {
|
|
return <div>{path}</div>
|
|
}
|
|
return <div>index page</div>
|
|
}
|
|
|
|
export default FileListing
|