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

export interface PipelineStageDetailsViewProps extends CommonProps {
  pipeline: Pipeline;
  stage: Stage | null;
  logs: Stage["logs"][];
  orgSlug: string;
  repoSlug: string;
}

const PipelineStageDetailsView: ReactView<PipelineStageDetailsViewProps> = ({
  commonProps,
  // pipeline,
  stage,
  logs,
  orgSlug,
  repoSlug,
}) => {
  return (
    <Layout {...commonProps} orgSlug={orgSlug} repoSlug={repoSlug}>
      <PageWrapper>
        <h2>Stage: {stage?.name ?? stage?.id ?? "Unknown"}</h2>
        <div>Logs: {logs?.length ?? 0}</div>
      </PageWrapper>
    </Layout>
  );
};

PipelineStageDetailsView.displayName = "PipelineStageDetailsView";
export default PipelineStageDetailsView;