import React from 'react'; import { Deployment } from 'gql-client'; import { relativeTimeMs } from 'utils/time'; import { SHORT_COMMIT_HASH_LENGTH } from '../../../../constants'; import { BranchStrokeIcon, ClockOutlineIcon, CommitIcon, } from 'components/shared/CustomIcon'; import { Avatar } from 'components/shared/Avatar'; import { getInitials } from 'utils/geInitials'; import { OverflownText } from 'components/shared/OverflownText'; import { Tag, TagProps } from 'components/shared/Tag'; interface DeploymentDialogBodyCardProps { deployment: Deployment; chip?: { value: string; type?: TagProps['type']; }; } const DeploymentDialogBodyCard = ({ chip, deployment, }: DeploymentDialogBodyCardProps) => { const commit = deployment.commitHash.substring(0, SHORT_COMMIT_HASH_LENGTH) + ' ' + deployment.commitMessage; return (
{deployment.url}
{/* Branch & commit */}{deployment.branch}
{relativeTimeMs(deployment.createdAt)}
{deployment.createdBy.name ?? 'Unknown'}