diff --git a/src/frontend/src/pages/ApiKeysPage/index.tsx b/src/frontend/src/pages/ApiKeysPage/index.tsx index e2e3bbebe..d4f6b616a 100644 --- a/src/frontend/src/pages/ApiKeysPage/index.tsx +++ b/src/frontend/src/pages/ApiKeysPage/index.tsx @@ -103,15 +103,18 @@ export default function ApiKeysPage() {
- {keysList.current.length === 0 && !loadingKeys && ( - <> -
-

- This user does not have any keys assigned at the moment. -

-
- - )} + {keysList.current && + keysList.current.length === 0 && + !loadingKeys && ( + <> +
+

+ This user does not have any keys assigned at the + moment. +

+
+ + )} <> {loadingKeys && (
@@ -124,103 +127,105 @@ export default function ApiKeysPage() { (loadingKeys ? " border-0" : "") } > - {keysList.current.length > 0 && !loadingKeys && ( - - - - Name - Key - Created - - Last Used - -
- -
-
-
- -
-
- {!loadingKeys && ( - - {keysList.current.map( - (api_keys: ApiKey, index: number) => ( - - - + {keysList.current && + keysList.current.length > 0 && + !loadingKeys && ( +
+ + + Name + Key + Created + + Last Used + +
+ +
+
+
+ +
+
+ {!loadingKeys && ( + + {keysList.current.map( + (api_keys: ApiKey, index: number) => ( + + + + + {api_keys.name} + + + + - {api_keys.name} + {api_keys.api_key} - - - - - {api_keys.api_key} - - - - {moment(api_keys.created_at).format( - "YYYY-MM-DD HH:mm" - )} - - - {moment(api_keys.last_used_at).format( - "YYYY-MM-DD HH:mm" - ) === "Invalid date" - ? "-" - : moment(api_keys.last_used_at).format( - "YYYY-MM-DD HH:mm" - )} - - -
- { - console.log(keys); - handleDeleteKey(keys); - }} - > - + + {moment(api_keys.created_at).format( + "YYYY-MM-DD HH:mm" + )} + + + {moment(api_keys.last_used_at).format( + "YYYY-MM-DD HH:mm" + ) === "Invalid date" + ? "-" + : moment(api_keys.last_used_at).format( + "YYYY-MM-DD HH:mm" + )} + + +
+ { + console.log(keys); + handleDeleteKey(keys); + }} > - - - -
-
- - ) - )} - - )} -
- )} + + + + +
+ + + ) + )} + + )} + + )}