GitFOSS
.ts
TypeScript
(application/typescript)
// 1st-party
import type { ReactView } from "@ethicdevs/react-monolith";
// 3rd-party
import React from "react";
// generated via script[generate:prisma]
import type { Organization, PullRequest } from "@prisma/client";
// app
import type { CommonProps, RepositoryWithForkedFromRepo } from "../../types";
import { Grid, IslandWrapper, Layout, PageWrapper } from "../../components";
// app islands
import RepositoryHero from "../../islands/RepositoryHero";

export interface RepositoryPullRequestsViewProps extends CommonProps {
  parentOrg: Organization;
  pullRequests: PullRequest[];
  repo: RepositoryWithForkedFromRepo;
}

const RepositoryPullRequestsView: ReactView<RepositoryPullRequestsViewProps> =
  ({ commonProps, parentOrg, pullRequests, repo }) => {
    return (
      <Layout {...commonProps}>
        <PageWrapper>
          <IslandWrapper data-islandid={`${RepositoryHero.name}$$0`}>
            <RepositoryHero
              forkedFromRepo={repo.forkedFromRepo}
              forksCount={repo.forks.length}
              parentOrg={parentOrg}
              path={`Pull Requests`}
              repo={repo}
            />
          </IslandWrapper>
          <Grid.Col fluid style={{ marginTop: 32 }}>
            <a href={`/${parentOrg.slug}/${repo.slug}/pulls/new`}>
              New Pull Request
            </a>
          </Grid.Col>
          <Grid.Col fluid style={{ marginTop: 32 }}>
            <pre>
              <code>{JSON.stringify(pullRequests, null, 2)}</code>
            </pre>
          </Grid.Col>
        </PageWrapper>
      </Layout>
    );
  };

RepositoryPullRequestsView.displayName = "RepositoryPullRequestsView";
export default RepositoryPullRequestsView;