@@ -18,6 +18,7 @@ import { Timestamp } from "@bufbuild/protobuf";
18
18
import Alert from "../components/Alert" ;
19
19
import { InputWithCopy } from "../components/InputWithCopy" ;
20
20
import { copyToClipboard } from "../utils" ;
21
+ import TokenEntry from "./TokenEntry" ;
21
22
22
23
function PersonalAccessTokens ( ) {
23
24
const { enablePersonalAccessTokens } = useContext ( FeatureFlagContext ) ;
@@ -197,14 +198,16 @@ function ListAccessTokensView() {
197
198
198
199
return (
199
200
< >
200
- < div className = "flex items-center sm:justify-between mb-2 " >
201
+ < div className = "flex items-center sm:justify-between mb-4 " >
201
202
< div >
202
203
< h3 > Personal Access Tokens</ h3 >
203
204
< h2 className = "text-gray-500" > Create or regenerate active personal access tokens.</ h2 >
204
205
</ div >
205
- < Link to = { settingsPathPersonalAccessTokenCreate } >
206
- < button > New Personal Access Token</ button >
207
- </ Link >
206
+ { tokens . length > 0 && (
207
+ < Link to = { settingsPathPersonalAccessTokenCreate } >
208
+ < button > New Personal Access Token</ button >
209
+ </ Link >
210
+ ) }
208
211
</ div >
209
212
< >
210
213
{ tokenInfo && (
@@ -251,16 +254,30 @@ function ListAccessTokensView() {
251
254
</ >
252
255
) }
253
256
</ >
254
- { tokens . length > 0 && (
255
- < ul >
257
+ { tokens . length === 0 ? (
258
+ < div className = "bg-gray-100 dark:bg-gray-800 rounded-xl w-full py-28 flex flex-col items-center" >
259
+ < h3 className = "text-center pb-3 text-gray-500 dark:text-gray-400" >
260
+ No Personal Access Tokens (PAT)
261
+ </ h3 >
262
+ < p className = "text-center pb-6 text-gray-500 text-base w-96" >
263
+ Generate a personal access token (PAT) for applications that need access to the Gitpod API.{ " " }
264
+ </ p >
265
+ < Link to = { settingsPathPersonalAccessTokenCreate } >
266
+ < button > New Personal Access Token</ button >
267
+ </ Link >
268
+ </ div >
269
+ ) : (
270
+ < >
271
+ < div className = "px-6 py-3 flex justify-between space-x-2 text-sm text-gray-400 mb-2 bg-gray-100 rounded-xl" >
272
+ < h2 className = "w-3/12" > Token Name</ h2 >
273
+ < h2 className = "w-3/12" > Permissions</ h2 >
274
+ < h2 className = "w-3/12" > Expires</ h2 >
275
+ < div className = "w-3/12" > </ div >
276
+ </ div >
256
277
{ tokens . map ( ( t : PersonalAccessToken ) => {
257
- return (
258
- < li >
259
- { t . id } - { t . name } - { t . value }
260
- </ li >
261
- ) ;
278
+ return < TokenEntry token = { t } /> ;
262
279
} ) }
263
- </ ul >
280
+ </ >
264
281
) }
265
282
</ >
266
283
) ;
0 commit comments