@@ -3,14 +3,15 @@ import { numberFormat } from "../../utils/format";
3
3
import { Popover , PopoverPanel , PopoverButton } from "@headlessui/react" ;
4
4
import { PiDotsThreeCircle , PiSmileySadThin } from "react-icons/pi" ;
5
5
6
- const TrendingItem = ( { title, category, posts } ) => {
6
+ const TrendingItem = ( { title, category, posts, id } ) => {
7
7
return (
8
- < div >
8
+ < >
9
9
< button className = "w-full flex items-start justify-between px-4 py-2 hover:bg-[--hover] transition-colors" >
10
10
< div className = "flex flex-col items-start" >
11
- < span className = "text-xs text-[color:var(--text-color-secondary)]" >
12
- { category }
13
- </ span >
11
+ < div className = "text-xs text-[color:var(--text-color-secondary)] flex items-center gap-1" >
12
+ { id && < span > { id } ·</ span > }
13
+ < span className = "" > { category } </ span >
14
+ </ div >
14
15
< span className = "text-sm font-semibold text-[color:var(--text-color)]" >
15
16
#{ title }
16
17
</ span >
@@ -19,7 +20,7 @@ const TrendingItem = ({ title, category, posts }) => {
19
20
</ span >
20
21
</ div >
21
22
< Popover className = "relative text-[color:var(--text-color)]" >
22
- < PopoverButton >
23
+ < PopoverButton className = "focus:outline-none" >
23
24
< PiDotsThreeCircle className = "text-xl hover:text-[color:var(--color-primary)] transition-colors" />
24
25
</ PopoverButton >
25
26
< PopoverPanel className = "absolute bg-[color:var(--background-primary)] top-0 z-40 right-0 min-w-[300px] shadow-box rounded-xl " >
@@ -34,14 +35,15 @@ const TrendingItem = ({ title, category, posts }) => {
34
35
</ PopoverPanel >
35
36
</ Popover >
36
37
</ button >
37
- </ div >
38
+ </ >
38
39
) ;
39
40
} ;
40
41
41
42
TrendingItem . propTypes = {
42
43
title : PropTypes . string . isRequired ,
43
44
category : PropTypes . string . isRequired ,
44
45
posts : PropTypes . number . isRequired ,
46
+ id : PropTypes . number ,
45
47
} ;
46
48
47
49
export default TrendingItem ;
0 commit comments