.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 } from "@prisma/client";
// app
import type { CommonProps } from "../../types";
// import { AppRoute } from "../../routes.defs";

export interface PipelinesViewProps extends CommonProps {
  pipelines: Pipeline[];
  orgSlug: string;
  repoSlug: string;
}

const PipelinesView: ReactView<PipelinesViewProps> = ({
  // commonProps,
  pipelines,
  orgSlug,
  repoSlug,
}) => {
  return (
    <div>
      <h2>
        Pipelines for {orgSlug}/{repoSlug}
      </h2>
      <ul>
        {pipelines.map((p) => (
          <li key={p.id}>
            <span>
              {p.name ?? `Pipeline ${p.id}`} — status: {p.status ?? "unknown"}
            </span>
          </li>
        ))}
      </ul>
    </div>
  );
};

PipelinesView.displayName = "PipelinesView";
export default PipelinesView;