11import type { FC , MouseEvent } from 'react' ;
22
33import { FeedPersonIcon , MarkGithubIcon } from '@primer/octicons-react' ;
4- import { Avatar } from '@primer/react' ;
4+ import { Avatar , RelativeTime , Stack , Text } from '@primer/react' ;
55
66import { IconColor , Opacity , Size } from '../../types' ;
77import type { Notification } from '../../typesGitHub' ;
88import { cn } from '../../utils/cn' ;
9- import {
10- formatNotificationUpdatedAt ,
11- isNonHumanUser ,
12- } from '../../utils/helpers' ;
9+ import { isNonHumanUser } from '../../utils/helpers' ;
1310import { openUserProfile } from '../../utils/links' ;
1411import { formatReason } from '../../utils/reason' ;
1512import { Pills } from './Pills' ;
@@ -23,13 +20,8 @@ export const NotificationFooter: FC<INotificationFooter> = ({
2320} : INotificationFooter ) => {
2421 const reason = formatReason ( notification . reason ) ;
2522
26- const updatedAt = formatNotificationUpdatedAt ( notification ) ;
27- const updatedLabel = notification . subject . user
28- ? `${ notification . subject . user . login } updated ${ updatedAt } `
29- : `Updated ${ updatedAt } ` ;
30-
3123 return (
32- < div className = "flex flex-wrap items- center gap-1 ">
24+ < Stack direction = "horizontal" align = " center" gap = "condensed" wrap = "wrap ">
3325 { notification . subject . user ? (
3426 < Avatar
3527 title = { `View profile: ${ notification . subject . user . login } ` }
@@ -53,19 +45,15 @@ export const NotificationFooter: FC<INotificationFooter> = ({
5345 ) }
5446 </ >
5547 ) }
56- < span
57- className = { cn ( 'text-xs capitalize' , Opacity . MEDIUM ) }
58- title = { reason . description }
59- >
60- { reason . title }
61- </ span >
62- < span
63- className = { cn ( 'text-xs capitalize' , Opacity . MEDIUM ) }
64- title = { updatedLabel }
65- >
66- { updatedAt }
48+ < span className = { cn ( 'text-xs' , Opacity . MEDIUM ) } >
49+ < Stack direction = "horizontal" gap = "condensed" >
50+ < Text title = { reason . description } > { reason . title } </ Text >
51+ < Text > •</ Text >
52+ < RelativeTime datetime = { notification . updated_at } />
53+ </ Stack >
6754 </ span >
55+
6856 < Pills notification = { notification } />
69- </ div >
57+ </ Stack >
7058 ) ;
7159} ;
0 commit comments