| 23 | }; |
| 24 | |
| 25 | export const TimelineEntry: FC<TimelineEntryProps> = ({ |
| 26 | entry, |
| 27 | isFirst, |
| 28 | isLast, |
| 29 | }) => { |
| 30 | const { t } = useTranslation('changelog'); |
| 31 | |
| 32 | return ( |
| 33 | <div data-testid="changelog-entry" className="flex gap-4"> |
| 34 | <div className="flex w-4 flex-col items-center gap-1"> |
| 35 | <div |
| 36 | className={cn( |
| 37 | 'w-1 flex-1 rounded-b-full', |
| 38 | isFirst ? 'bg-transparent' : 'bg-border', |
| 39 | )} |
| 40 | /> |
| 41 | <TimelineNode isLatest={isFirst} /> |
| 42 | <div |
| 43 | className={cn( |
| 44 | 'w-1 flex-1 rounded-t-full', |
| 45 | isLast ? 'bg-transparent' : 'bg-border', |
| 46 | )} |
| 47 | /> |
| 48 | </div> |
| 49 | <div className="my-4 flex flex-1 flex-col gap-1"> |
| 50 | <div className="flex items-center justify-between px-1"> |
| 51 | <Badge |
| 52 | data-testid="changelog-type-badge" |
| 53 | variant="pill" |
| 54 | color={TYPE_COLORS[entry.type] as never} |
| 55 | > |
| 56 | {t(`types.${entry.type}`)} |
| 57 | </Badge> |
| 58 | {entry.tags && entry.tags.length > 0 && ( |
| 59 | <div className="flex gap-1.5"> |
| 60 | {entry.tags.map((tag) => ( |
| 61 | <Badge |
| 62 | key={tag.label} |
| 63 | data-testid="changelog-tag-badge" |
| 64 | variant="pill" |
| 65 | color={tag.color as never} |
| 66 | > |
| 67 | {tag.label} |
| 68 | </Badge> |
| 69 | ))} |
| 70 | </div> |
| 71 | )} |
| 72 | </div> |
| 73 | <div className="border-border bg-background-secondary shadow-shadow flex-1 rounded-md border-(length:--border-width) p-4"> |
| 74 | <span data-testid="changelog-description">{entry.description}</span> |
| 75 | </div> |
| 76 | <div className="flex items-center justify-between px-1"> |
| 77 | <span data-testid="changelog-date" className="text-xs"> |
| 78 | {DateTime.fromISO(entry.date).toLocaleString(DateTime.DATE_MED)} |
| 79 | </span> |
| 80 | {entry.contributors && entry.contributors.length > 0 && ( |
| 81 | <div className="flex gap-1.5"> |
| 82 | {entry.contributors.map((username) => ( |