import type { ReactView } from "@ethicdevs/react-monolith";
import React from "react";
import type { Artefact, Pipeline } from "@prisma/client";
import type { CommonProps } from "../../types";
export interface PipelineArtefactsViewProps extends CommonProps {
artefacts: Artefact[];
pipeline: Pipeline;
orgSlug: string;
repoSlug: string;
}
const PipelineArtefactsView: ReactView<PipelineArtefactsViewProps> = ({
artefacts,
pipeline,
}) => {
return (
<div>
<h2>Artefacts for pipeline {pipeline.name ?? pipeline.id}</h2>
{artefacts.length === 0 ? (
<p>No artefacts found.</p>
) : (
<ul>
{artefacts.map((artefact) => (
<li key={artefact.id}>
<span>{artefact.name ?? `Artefact ${artefact.id}`}</span>
{" - "}
<span>size: {artefact.size ?? ""}</span>
</li>
))}
</ul>
)}
</div>
);
};
PipelineArtefactsView.displayName = "PipelineArtefactsView";
export default PipelineArtefactsView;