import dayjs from 'dayjs' import { Tooltip, TooltipContent, TooltipTrigger } from 'ui' import { PageSection } from 'ui-patterns/PageSection' import { UpgradeStepsTable } from './UpgradeStepsTable' import { UPGRADE_STATE_CONTENT } from './types' type ActiveUpgradeViewProps = | { variant: 'upgrading' progress: string | undefined initiatedAt: string | undefined } | { variant: 'backingUp' initiatedAt: string | undefined } export const ActiveUpgradeView = (props: ActiveUpgradeViewProps) => { const { variant, initiatedAt } = props const content = UPGRADE_STATE_CONTENT[variant] const initiatedAtUTC = dayjs.utc(initiatedAt ?? 0).format('DD MMM YYYY HH:mm:ss') const initiatedAtLocal = dayjs .utc(initiatedAt ?? 0) .local() .format('DD MMM YYYY HH:mm:ss (ZZ)') return (

{content.stepsHeading}

{variant === 'upgrading' ? ( ) : ( )} {initiatedAt !== undefined && (

Upgrade began at{' '} {initiatedAtUTC} (UTC) {initiatedAtLocal} .

)}
) }