@@ -50,20 +50,8 @@ export default function VisitorClicks({
50
50
) ;
51
51
}
52
52
53
- if ( ! clickEvents ) {
54
- return (
55
- < Card >
56
- < CardHeader >
57
- < CardTitle className = "text-base font-medium" > Link Clicks</ CardTitle >
58
- </ CardHeader >
59
- < CardContent >
60
- < div className = "space-y-2" >
61
- < Skeleton className = "h-4 w-full" />
62
- < Skeleton className = "h-4 w-3/4" />
63
- </ div >
64
- </ CardContent >
65
- </ Card >
66
- ) ;
53
+ if ( ! clickEvents || clickEvents . data . length === 0 ) {
54
+ return null ;
67
55
}
68
56
69
57
return (
@@ -72,36 +60,29 @@ export default function VisitorClicks({
72
60
< CardTitle className = "text-base font-medium" > Link Clicks</ CardTitle >
73
61
</ CardHeader >
74
62
< CardContent >
75
- { clickEvents . data . length === 0 ? (
76
- < div className = "text-sm text-gray-500" > No links clicked yet</ div >
77
- ) : (
78
- < div className = "space-y-4" >
79
- { clickEvents . data . map ( ( event , index ) => (
80
- < div key = { index } className = "flex items-start space-x-3" >
81
- < ExternalLink className = "mt-0.5 h-4 w-4 flex-shrink-0 text-gray-400" />
82
- < div className = "space-y-1" >
83
- < div className = "text-sm" >
84
- < span className = "font-medium" >
85
- Page { event . page_number }
86
- </ span >
87
- :{ " " }
88
- < a
89
- href = { event . href }
90
- target = "_blank"
91
- rel = "noopener noreferrer"
92
- className = "text-blue-600 hover:underline"
93
- >
94
- { event . href }
95
- </ a >
96
- </ div >
97
- < div className = "text-xs text-gray-500" >
98
- { format ( new Date ( event . timestamp ) , "MMM d, yyyy HH:mm:ss" ) }
99
- </ div >
63
+ < div className = "space-y-4" >
64
+ { clickEvents . data . map ( ( event , index ) => (
65
+ < div key = { index } className = "flex items-start space-x-3" >
66
+ < ExternalLink className = "mt-0.5 h-4 w-4 flex-shrink-0 text-gray-400" />
67
+ < div className = "space-y-1" >
68
+ < div className = "text-sm" >
69
+ < span className = "font-medium" > Page { event . page_number } </ span > :{ " " }
70
+ < a
71
+ href = { event . href }
72
+ target = "_blank"
73
+ rel = "noopener noreferrer"
74
+ className = "text-blue-600 hover:underline"
75
+ >
76
+ { event . href }
77
+ </ a >
78
+ </ div >
79
+ < div className = "text-xs text-gray-500" >
80
+ { format ( new Date ( event . timestamp ) , "MMM d, yyyy HH:mm:ss" ) }
100
81
</ div >
101
82
</ div >
102
- ) ) }
103
- </ div >
104
- ) }
83
+ </ div >
84
+ ) ) }
85
+ </ div >
105
86
</ CardContent >
106
87
</ Card >
107
88
) ;
0 commit comments