import { head } from 'lodash'; import React from 'react'; import type { IExecution } from '../../domain'; import { timestamp } from '../../utils/timeFormatters'; export interface ICurrentlyRunningExecutionsProps { currentlyRunningExecutions: IExecution[]; } export class CurrentlyRunningExecutions extends React.Component { public render() { const { currentlyRunningExecutions } = this.props; const currentlyRunningExecution = head(currentlyRunningExecutions); return (

This pipeline is currently executing!

Execution started: {timestamp(currentlyRunningExecution.startTime)}
Current stage: {currentlyRunningExecution.currentStages && currentlyRunningExecution.currentStages.map((s: any, i: number) => { return {s.name}; })}
{currentlyRunningExecutions.length > 1 && (
{currentlyRunningExecutions.length - 1 + ' other execution(s)'}
)}
); } }