17 lines
527 B
TypeScript
17 lines
527 B
TypeScript
|
import RenderView from "./ContentRenderer.tsx";
|
||
|
import UpList from "./UpList.tsx";
|
||
|
import { extname } from "path/mod.ts";
|
||
|
|
||
|
export default function FileViewer(props: { path: string }) {
|
||
|
const { path } = props;
|
||
|
const srcPath = `/fs/${path}`;
|
||
|
return (
|
||
|
<div class="p-4 mx-auto max-w-screen-md">
|
||
|
<UpList path={path} />
|
||
|
<a href={srcPath}>Direct link</a>
|
||
|
<div class="p-2 border-2 rounded-lg">
|
||
|
<RenderView src={srcPath}/>
|
||
|
</div>
|
||
|
</div>
|
||
|
)
|
||
|
}
|