11<script lang="ts" setup>
22import dayjs from ' dayjs'
3- import { MinimalRepository , Thread } from ' ../api/notifications'
3+ import type { MinimalRepository , Thread } from ' ../api/notifications'
44import type { NotificationList } from ' ../types'
55import { formatReason , isRepository , notificationSubjectIcon } from ' ../utils/notification'
66import Separator from ' ./Separator.vue'
@@ -33,15 +33,15 @@ function handleRepoClick(repo: MinimalRepository) {
3333 >
3434 <button
3535 class =" notification-title"
36- @click =" handleRepoClick(value as MinimalRepository )"
36+ @click =" handleRepoClick(value)"
3737 >
3838 <img
3939 class =" notification-title-icon"
40- :src =" ( value as MinimalRepository) .owner.avatar_url"
40+ :src =" value.owner.avatar_url"
4141 alt =" repo logo"
4242 >
4343 <span class =" notification-title-text" >
44- {{ ( value as MinimalRepository) .full_name }}
44+ {{ value.full_name }}
4545 </span >
4646 </button >
4747
@@ -51,23 +51,23 @@ function handleRepoClick(repo: MinimalRepository) {
5151 <button
5252 v-else
5353 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)"
5656 >
5757 <Component
58- :is =" notificationSubjectIcon(( value as Thread) .subject.type)"
58+ :is =" notificationSubjectIcon(value.subject.type)"
5959 class =" notification-item-icon"
6060 />
6161
6262 <div class =" notification-item-content" >
6363 <div class =" notification-item-content-title" >
64- {{ ( value as Thread) .subject.title }}
64+ {{ value.subject.title }}
6565 </div >
6666
6767 <div class =" notification-item-content-subtitle" >
68- {{ formatReason(( value as Thread) .reason) }}
68+ {{ formatReason(value.reason) }}
6969 -
70- {{ dayjs(( value as Thread) .updated_at).fromNow() }}
70+ {{ dayjs(value.updated_at).fromNow() }}
7171 </div >
7272 </div >
7373 </button >
0 commit comments