+
+
+ Name
+ Key
+ Created by
+ Created at
+
+
+
+
+ {sortedApiKeys.length === 0 ? (
+
+
+ Click on "Add API Key" button above to create your
+ first API key.
+
+
+ ) : (
+ sortedApiKeys.map((apiKey, index) => (
+
+ {apiKey.name}
+
+ {apiKey.maskedValue}
+
+ {apiKey.createdBy?.email}
+
+ {new Date(apiKey.createdAt).toLocaleString()}
+
+
+
+
+
+
+
+ {
+ setNewApiKeyInput(apiKey.name)
+ setCurrentKey(apiKey)
+ setIsKeyDialogOpen(true)
+ }}
+ >
+
+ Edit
+
+ {
+ setCurrentKey(apiKey)
+ setIsDeleteDialogOpen(true)
+ }}
+ >
+
+ Delete
+
+
+
+
+
+ ))
+ )}
+
+
- {apiKeys.map((apiKey, index) => (
-
+
+
+
+ You are about to {currentKey ? 'edit' : 'create'} an API key
+
+
+
- ))}
+
+ {
+ setIsKeyDialogOpen(false)
+ setCurrentKey(null)
+ setNewApiKeyInput('')
+ }}
+ >
+ Cancel
+
+
+ {currentKey ? 'Update' : 'Create'}
+
+
+
+
+
+
+
+
+ Your API key
+
+ You will only see the API key once. Make sure to copy it now.
+
+
+
+
+ {
+ setIsKeyPreviewDialogOpen(false)
+ setCurrentKey(null)
+ }}
+ >
+ Cancel
+
+ {
+ copyApiKey()
+ setIsKeyPreviewDialogOpen(false)
+ }}
+ >
+ Copy
+
+
+
+
+
-
+
-
+
- You are about to delete an API key
-
- This action cannot be undone. This will permanently delete the
- API key with immediate effect.
+
+ You are about to delete an API key
+
+
+ This action cannot be undone. This will permanently delete the API
+ key with immediate effect.
- Cancel
- Continue
+ {
+ setIsDeleteDialogOpen(false)
+ setCurrentKey(null)
+ }}
+ >
+ Cancel
+
+
+ Delete
+
-