import type { ReactView } from "@ethicdevs/react-monolith";
import React from "react";
import type { Organization, Repository, User } from "@prisma/client";
import type { CommonProps, RepositoryFileContent } from "../../types";
import { Layout, PageWrapper } from "../../components";
export interface RepositoryBrowserViewProps extends CommonProps {
currentUser: null | User;
fileContent: RepositoryFileContent;
parentOrg: Organization;
path: string;
ref: string;
repo: Repository;
}
const RepositoryBrowserView: ReactView<RepositoryBrowserViewProps> = ({
commonProps,
fileContent,
parentOrg,
path,
ref,
repo,
}) => {
return (
<Layout {...commonProps} showSideMenu={false}>
<PageWrapper>
<h1>
{parentOrg.displayName || parentOrg.slug}
{" / "}
{repo.displayName || repo.slug}
{" / "}
{ref}
{" / "}
{path}
</h1>
<div>
<code>
<pre>{fileContent.content}</pre>
</code>
</div>
</PageWrapper>
</Layout>
);
};
RepositoryBrowserView.displayName = "RepositoryBrowserView";
export default RepositoryBrowserView;