1
1
import { Badge } from "@/components/ui/badge" ;
2
- import {
3
- Table ,
4
- TableBody ,
5
- TableCaption ,
6
- TableCell ,
7
- TableHead ,
8
- TableHeader ,
9
- TableRow ,
10
- } from "@/components/ui/table" ;
2
+ import { Table , TableBody , TableCaption , TableCell , TableHead , TableHeader , TableRow } from "@/components/ui/table" ;
11
3
import Link from "next/link" ;
12
4
import { GithubBugcopTask } from "./gh-bugcop" ;
13
- // import { GithubBugcopTaskMetaEditor } from "./GithubBugcopTaskMetaEditor";
14
5
15
6
/**
16
7
* GitHub Bug Cop Task Dashboard
@@ -20,7 +11,6 @@ export default async function GithubBugCopTaskPage() {
20
11
// Fetch all tasks from the database
21
12
const tasks = await GithubBugcopTask . find ( { } ) . sort ( { lastChecked : - 1 } ) . toArray ( ) ;
22
13
23
-
24
14
const formatDate = ( date : Date | string | undefined ) => {
25
15
if ( ! date ) return "N/A" ;
26
16
try {
@@ -36,7 +26,6 @@ export default async function GithubBugCopTaskPage() {
36
26
}
37
27
} ;
38
28
39
-
40
29
const getIssueNumber = ( url : string ) => {
41
30
const match = url . match ( / \/ ( \d + ) $ / ) ;
42
31
return match ?. [ 1 ] ? `#${ match [ 1 ] } ` : "" ;
@@ -60,8 +49,7 @@ export default async function GithubBugCopTaskPage() {
60
49
< TableCaption >
61
50
{ tasks . length === 0
62
51
? "No bug cop tasks found"
63
- : `A list of ${ tasks . length } bug cop task${ tasks . length !== 1 ? 's' : '' } being tracked`
64
- }
52
+ : `A list of ${ tasks . length } bug cop task${ tasks . length !== 1 ? "s" : "" } being tracked` }
65
53
</ TableCaption >
66
54
< TableHeader >
67
55
< TableRow >
@@ -86,8 +74,12 @@ export default async function GithubBugCopTaskPage() {
86
74
tasks . map ( ( task : any ) => (
87
75
< TableRow key = { task . url } >
88
76
< TableCell >
89
- < Link className = "text-sm text-muted-foreground outline outline-[1px] rounded-full px-2 py-1 whitespace-pre" href = { `https://github.com/${ task . user } ` }
90
- target = "_blank" rel = "noopener noreferrer" >
77
+ < Link
78
+ className = "text-sm text-muted-foreground outline outline-[1px] rounded-full px-2 py-1 whitespace-pre"
79
+ href = { `https://github.com/${ task . user } ` }
80
+ target = "_blank"
81
+ rel = "noopener noreferrer"
82
+ >
91
83
@{ task . user }
92
84
</ Link >
93
85
</ TableCell >
@@ -100,19 +92,15 @@ export default async function GithubBugCopTaskPage() {
100
92
>
101
93
< div className = "flex items-center gap-2" >
102
94
< Badge className = "w-16 text-center justify-center" >
103
- { ( { " pull_request" : "PR" , ' issue' : "Issue" } as any ) [ task . type ] || "Task" }
95
+ { ( { pull_request : "PR" , issue : "Issue" } as any ) [ task . type ] || "Task" }
104
96
</ Badge >
105
- < span className = "text-sm text-muted-foreground" >
106
- { getIssueNumber ( task . url ) }
107
- </ span >
108
- < h3 >
109
- { task . title }
110
- </ h3 >
97
+ < span className = "text-sm text-muted-foreground" > { getIssueNumber ( task . url ) } </ span >
98
+ < h3 > { task . title } </ h3 >
111
99
</ div >
112
100
</ Link >
113
101
</ TableCell >
114
102
< TableCell className = "text-center" >
115
- < Badge variant = { ' outline' } > { task . status ?. toUpperCase ( ) || '?' } </ Badge >
103
+ < Badge variant = { " outline" } > { task . status ?. toUpperCase ( ) || "?" } </ Badge >
116
104
</ TableCell >
117
105
< TableCell className = "text-center text-sm text-muted-foreground" >
118
106
{ formatDate ( task . updatedAt ) }
@@ -126,13 +114,11 @@ export default async function GithubBugCopTaskPage() {
126
114
</ Badge >
127
115
) ) }
128
116
</ div >
129
- ) : (
130
- null
131
- ) } </ TableCell >
117
+ ) : null }
118
+ </ TableCell >
132
119
< TableCell className = "text-center text-sm text-muted-foreground" >
133
120
{ formatDate ( task . lastChecked ) }
134
121
</ TableCell >
135
-
136
122
</ TableRow >
137
123
) )
138
124
) }
@@ -142,9 +128,11 @@ export default async function GithubBugCopTaskPage() {
142
128
143
129
< div className = "mt-6 text-sm text-muted-foreground" >
144
130
< p >
145
- { ( 'This table shows all GitHub issues and pull requests with the "Bug Cop" label that have been processed by the automated tracking system. The system monitors repositories, sends Slack notifications, and requests reviews for bug-cop-related items.' ) }
131
+ {
132
+ 'This table shows all GitHub issues and pull requests with the "Bug Cop" label that have been processed by the automated tracking system. The system monitors repositories, sends Slack notifications, and requests reviews for bug-cop-related items.'
133
+ }
146
134
</ p >
147
135
</ div >
148
136
</ div >
149
137
) ;
150
- }
138
+ }
0 commit comments