1
1
<script lang="ts" setup>
2
2
import dayjs from ' dayjs'
3
- import { MinimalRepository , Thread } from ' ../api/notifications'
3
+ import type { MinimalRepository , Thread } from ' ../api/notifications'
4
4
import type { NotificationList } from ' ../types'
5
5
import { formatReason , isRepository , notificationSubjectIcon } from ' ../utils/notification'
6
6
import Separator from ' ./Separator.vue'
@@ -33,15 +33,15 @@ function handleRepoClick(repo: MinimalRepository) {
33
33
>
34
34
<button
35
35
class =" notification-title"
36
- @click =" handleRepoClick(value as MinimalRepository )"
36
+ @click =" handleRepoClick(value)"
37
37
>
38
38
<img
39
39
class =" notification-title-icon"
40
- :src =" ( value as MinimalRepository) .owner.avatar_url"
40
+ :src =" value.owner.avatar_url"
41
41
alt =" repo logo"
42
42
>
43
43
<span class =" notification-title-text" >
44
- {{ ( value as MinimalRepository) .full_name }}
44
+ {{ value.full_name }}
45
45
</span >
46
46
</button >
47
47
@@ -51,23 +51,23 @@ function handleRepoClick(repo: MinimalRepository) {
51
51
<button
52
52
v-else
53
53
class =" notification-item"
54
- :class =" { 'notification-item-read': !( value as Thread) .unread }"
55
- @click =" handleThreadClick(value as Thread )"
54
+ :class =" { 'notification-item-read': !value.unread }"
55
+ @click =" handleThreadClick(value)"
56
56
>
57
57
<Component
58
- :is =" notificationSubjectIcon(( value as Thread) .subject.type)"
58
+ :is =" notificationSubjectIcon(value.subject.type)"
59
59
class =" notification-item-icon"
60
60
/>
61
61
62
62
<div class =" notification-item-content" >
63
63
<div class =" notification-item-content-title" >
64
- {{ ( value as Thread) .subject.title }}
64
+ {{ value.subject.title }}
65
65
</div >
66
66
67
67
<div class =" notification-item-content-subtitle" >
68
- {{ formatReason(( value as Thread) .reason) }}
68
+ {{ formatReason(value.reason) }}
69
69
-
70
- {{ dayjs(( value as Thread) .updated_at).fromNow() }}
70
+ {{ dayjs(value.updated_at).fromNow() }}
71
71
</div >
72
72
</div >
73
73
</button >
0 commit comments