fix: api key details section (#7488)

This commit is contained in:
Frane Polić
2024-05-28 08:45:34 +02:00
committed by GitHub
parent ad21bd30b1
commit 582c9c9acf
2 changed files with 17 additions and 6 deletions
@@ -1452,6 +1452,7 @@
"fields": {
"lastUsedAtLabel": "Last used at",
"revokedByLabel": "Revoked by",
"revokedAtLabel": "Revoked at",
"createdByLabel": "Created by"
}
},
@@ -195,12 +195,22 @@ export const ApiKeyGeneralSection = ({ apiKey }: ApiKeyGeneralSectionProps) => {
<ActionBy userId={apiKey.created_by} />
</div>
{apiKey.revoked_at && (
<div className="grid grid-cols-2 items-center px-6 py-4">
<Text size="small" leading="compact" weight="plus">
{t("apiKeyManagement.fields.revokedByLabel")}
</Text>
<ActionBy userId={apiKey.revoked_by} />
</div>
<>
<div className="text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4">
<Text size="small" leading="compact" weight="plus">
{t("apiKeyManagement.fields.revokedAtLabel")}
</Text>
<Text size="small" leading="compact">
{getFullDate({ date: apiKey.revoked_at, includeTime: true })}
</Text>
</div>
<div className="text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4">
<Text size="small" leading="compact" weight="plus">
{t("apiKeyManagement.fields.revokedByLabel")}
</Text>
<ActionBy userId={apiKey.revoked_by} />
</div>
</>
)}
</Container>
)