9
9
<div class =" flex flex-row text-sm items-center justify-between w-full" >
10
10
<NuxtLink :href =" accountUrl" class =" font-semibold text-gray-200 line-clamp-1 break-all" >
11
11
<Skeleton :enabled =" !note" :min-width =" 90" :max-width =" 170" shape =" rect" >
12
- {{
13
- note?.account.display_name }}
12
+ {{ note?.account.display_name }}
14
13
</Skeleton >
15
14
</NuxtLink >
16
15
<NuxtLink :href =" noteUrl" class =" text-gray-300 ml-2 line-clamp-1 break-all shrink-0" >
33
32
<div class =" flex flex-row items-center justify-between w-full" >
34
33
<NuxtLink :href =" accountUrl" class =" font-semibold text-gray-200 line-clamp-1 break-all" >
35
34
<Skeleton :enabled =" !note" :min-width =" 90" :max-width =" 170" shape =" rect" >
36
- {{
37
- note?.account.display_name }}
35
+ {{ note?.account.display_name }}
38
36
</Skeleton >
39
37
</NuxtLink >
40
- <NuxtLink :href =" noteUrl" class =" text-gray-300 text-sm ml-2 line-clamp-1 break-all shrink-0"
41
- :alt = " fullTime " : title =" fullTime " >
42
- <Skeleton :enabled = " ! note" :min- width =" 50 " :max-width = " 100 " shape = " rect " >
43
- {{ timeAgo }}
44
- </ Skeleton >
38
+ <NuxtLink v-if = " note " :href =" noteUrl" class =" text-gray-300 text-sm ml-2 line-clamp-1 break-all shrink-0"
39
+ :title =" visibilities[note.visibility].text " >
40
+ <iconify-icon :icon = " visibilities[ note.visibility].icon " width =" 1.25rem " height = " 1.25rem "
41
+ class = " text-gray-400 " aria-hidden = " true " />
42
+ <span class = " sr-only " >{{ visibilities[note.visibility].text }}</ span >
45
43
</NuxtLink >
46
44
</div >
47
- <span class =" text-gray-300 text-sm line-clamp-1 break-all w-full group" >
48
- <Skeleton :enabled =" !note" :min-width =" 130" :max-width =" 250" shape =" rect" >
49
- <span class =" group-hover:hidden" >
50
- @{{
51
- note?.account.acct
52
- }}</span >
53
- <span @click =" copyAccount" v-if =" !hasCopied"
54
- class =" hidden select-none group-hover:flex cursor-pointer items-center gap-x-1" >
55
- <iconify-icon icon =" tabler:clipboard" height =" 1rem" width =" 1rem" class =" text-gray-200"
56
- aria-hidden =" true" />
57
- Click to copy
58
- </span >
59
- <span v-else class =" hidden group-hover:flex select-none items-center gap-x-1" >
60
- <iconify-icon icon =" tabler:check" height =" 1rem" width =" 1rem" class =" text-green-500"
61
- aria-hidden =" true" />
62
- Copied!
63
- </span >
64
- </Skeleton >
65
- </span >
45
+ <div class =" flex flex-row items-center justify-between w-full group" >
46
+ <span class =" text-gray-300 text-sm line-clamp-1 break-all w-full" >
47
+ <Skeleton :enabled =" !note" :min-width =" 130" :max-width =" 250" shape =" rect" >
48
+ <div class =" group-hover:hidden" >
49
+ <span class =" font-bold bg-gradient-to-tr from-primary-300 via-purple-300 to-indigo-400 text-transparent bg-clip-text" >@{{ username }}</span ><span class =" text-gray-500" >{{ instance && "@" }}{{ instance }}</span >
50
+ · ; <span
51
+ class =" text-gray-400 cursor-help ml-auto" :alt =" fullTime"
52
+ :title =" fullTime" >
53
+ <Skeleton :enabled =" !note" :min-width =" 10" :max-width =" 50" shape =" rect" >
54
+ {{ timeAgo }}
55
+ </Skeleton >
56
+ </span >
57
+ </div >
58
+ <span @click =" copyAccount" v-if =" !hasCopied"
59
+ class =" hidden select-none w-full group-hover:flex cursor-pointer items-center gap-x-1" >
60
+ <iconify-icon icon =" tabler:clipboard" height =" 1rem" width =" 1rem" class =" text-gray-200"
61
+ aria-hidden =" true" />
62
+ Click to copy
63
+ </span >
64
+ <span v-else class =" hidden group-hover:flex select-none items-center gap-x-1" >
65
+ <iconify-icon icon =" tabler:check" height =" 1rem" width =" 1rem" class =" text-green-500"
66
+ aria-hidden =" true" />
67
+ Copied!
68
+ </span >
69
+ </Skeleton >
70
+ </span >
71
+ </div >
66
72
</div >
67
73
</div >
68
74
</template >
@@ -78,9 +84,12 @@ const props = defineProps<{
78
84
small? : boolean ;
79
85
}>();
80
86
87
+ const username = props .note ?.account .acct .split (" @" )[0 ];
88
+ const instance = props .note ?.account .acct .split (" @" )[1 ];
89
+
81
90
const noteUrl = props .note && ` /@${props .note .account .acct }/${props .note .id } ` ;
82
91
const accountUrl = props .note && ` /@${props .note .account .acct } ` ;
83
- const timeAgo = useTimeAgo (props .note ?.created_at ?? 0 );
92
+ const timeAgo = useTimeAgo (props .note ?.created_at ?? 0 , {} );
84
93
const fullTime = Intl .DateTimeFormat (" default" , {
85
94
dateStyle: " medium" ,
86
95
timeStyle: " short" ,
@@ -97,4 +106,23 @@ const copyAccount = () => {
97
106
}, 2000 );
98
107
}
99
108
};
109
+
110
+ const visibilities = {
111
+ public: {
112
+ icon: " tabler:world" ,
113
+ text: " This note is public: it can be seen by anyone." ,
114
+ },
115
+ unlisted: {
116
+ icon: " tabler:lock-open" ,
117
+ text: " This note is unlisted: it can be seen by anyone with the link." ,
118
+ },
119
+ private: {
120
+ icon: " tabler:lock" ,
121
+ text: " This note is private: it can only be seen by followers." ,
122
+ },
123
+ direct: {
124
+ icon: " tabler:mail" ,
125
+ text: " This note is direct: it can only be seen by mentioned users." ,
126
+ },
127
+ };
100
128
</script >
0 commit comments