1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-13 13:48:59 +02:00

Only show timestamp if it's for the current or previous stage.

This commit is contained in:
Thomas Heartman 2025-07-23 16:26:31 +02:00
parent ca128cc7f6
commit 372c93829c
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78

View File

@ -13,8 +13,7 @@ import type {
import { HtmlTooltip } from '../../../common/HtmlTooltip/HtmlTooltip.tsx';
import ErrorIcon from '@mui/icons-material/Error';
import { useLocationSettings } from 'hooks/useLocationSettings';
import { formatDateYMDHM } from 'utils/formatDate';
import type { ReactNode } from 'react-markdown/lib/react-markdown';
import { formatDateYMDHM } from 'utils/formatDate.ts';
export type ISuggestChangeTimelineProps = {
timestamps?: Record<ChangeRequestState, string>;
@ -111,9 +110,10 @@ export const ChangeRequestTimeline: FC<ISuggestChangeTimelineProps> = ({
<StyledBox>
<StyledTimeline>
{data.map((title, index) => {
const timestampComponent = timestamps?.[title] ? (
<Timestamp timestamp={timestamps?.[title]} />
) : undefined;
const timestampComponent =
index <= activeIndex && timestamps?.[title] ? (
<Timestamp timestamp={timestamps?.[title]} />
) : undefined;
if (schedule && title === 'Scheduled') {
return (