1
1
import type { FC , MouseEvent } from 'react' ;
2
2
3
3
import { FeedPersonIcon , MarkGithubIcon } from '@primer/octicons-react' ;
4
- import { Avatar } from '@primer/react' ;
4
+ import { Avatar , RelativeTime , Stack , Text } from '@primer/react' ;
5
5
6
6
import { IconColor , Opacity , Size } from '../../types' ;
7
7
import type { Notification } from '../../typesGitHub' ;
8
8
import { cn } from '../../utils/cn' ;
9
- import {
10
- formatNotificationUpdatedAt ,
11
- isNonHumanUser ,
12
- } from '../../utils/helpers' ;
9
+ import { isNonHumanUser } from '../../utils/helpers' ;
13
10
import { openUserProfile } from '../../utils/links' ;
14
11
import { formatReason } from '../../utils/reason' ;
15
12
import { Pills } from './Pills' ;
@@ -23,13 +20,8 @@ export const NotificationFooter: FC<INotificationFooter> = ({
23
20
} : INotificationFooter ) => {
24
21
const reason = formatReason ( notification . reason ) ;
25
22
26
- const updatedAt = formatNotificationUpdatedAt ( notification ) ;
27
- const updatedLabel = notification . subject . user
28
- ? `${ notification . subject . user . login } updated ${ updatedAt } `
29
- : `Updated ${ updatedAt } ` ;
30
-
31
23
return (
32
- < div className = "flex flex-wrap items- center gap-1 ">
24
+ < Stack direction = "horizontal" align = " center" gap = "condensed" wrap = "wrap ">
33
25
{ notification . subject . user ? (
34
26
< Avatar
35
27
title = { `View profile: ${ notification . subject . user . login } ` }
@@ -53,19 +45,15 @@ export const NotificationFooter: FC<INotificationFooter> = ({
53
45
) }
54
46
</ >
55
47
) }
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 >
67
54
</ span >
55
+
68
56
< Pills notification = { notification } />
69
- </ div >
57
+ </ Stack >
70
58
) ;
71
59
} ;
0 commit comments