39 lines
818 B
TypeScript
39 lines
818 B
TypeScript
/// <reference path="../types/jsx.d.ts" />
|
|
import { React } from "../deps.ts";
|
|
import Base from "./_base.tsx";
|
|
import type { IPackage } from "../db.ts";
|
|
|
|
import { Main, Menu } from "./_default.tsx";
|
|
import { RenderFile, EntryList, BrowseHeader } from "./_browse.tsx";
|
|
|
|
export default async function index({
|
|
pkg,
|
|
version,
|
|
content,
|
|
ext,
|
|
path,
|
|
}: {
|
|
pkg: IPackage;
|
|
version?: string;
|
|
content: string;
|
|
ext: string;
|
|
path: string;
|
|
}) {
|
|
if (!pkg)
|
|
return (
|
|
<Base>
|
|
<h1>Not found</h1>
|
|
</Base>
|
|
);
|
|
|
|
return (
|
|
<Base title={"DenReg - " + pkg.name}>
|
|
<Main>
|
|
<BrowseHeader pkg={pkg} version={version} path={path} />
|
|
<RenderFile content={content} ext={ext} />
|
|
</Main>
|
|
<Menu></Menu>
|
|
</Base>
|
|
);
|
|
}
|