diff --git a/public/app/features/serviceaccounts/components/CreateTokenModal.tsx b/public/app/features/serviceaccounts/components/CreateTokenModal.tsx
index ba48c05a717..5a90a71839b 100644
--- a/public/app/features/serviceaccounts/components/CreateTokenModal.tsx
+++ b/public/app/features/serviceaccounts/components/CreateTokenModal.tsx
@@ -8,11 +8,7 @@ import {
ClipboardButton,
DatePickerWithInput,
Field,
- FieldSet,
- HorizontalGroup,
- Icon,
Input,
- Label,
Modal,
RadioButtonGroup,
useStyles2,
@@ -76,12 +72,7 @@ export const CreateTokenModal = ({ isOpen, token, serviceAccountLogin, onCreateT
onClose();
};
- const modalTitle = (
-
-
- {!token ? 'Add service account token' : 'Service account token created'}
-
- );
+ const modalTitle = !token ? 'Add service account token' : 'Service account token created';
return (
{!token ? (
-
-
+
+ {isWithExpirationDate && (
+
+
+
+ )}
+
+
+
) : (
<>
-
-
+
+
+
+ token}
+ >
+ Copy clipboard
+
+
+
+
token} onClipboardCopy={onCloseInternal}>
Copy to clipboard and close
-
+
>
)}
@@ -185,29 +172,11 @@ const getStyles = (theme: GrafanaTheme2) => {
modalContent: css`
overflow: visible;
`,
- modalRow: css`
- margin-bottom: ${theme.spacing(4)};
- `,
modalTokenRow: css`
display: flex;
`,
modalCopyToClipboardButton: css`
margin-left: ${theme.spacing(0.5)};
`,
- modalHeaderTitle: css`
- font-size: ${theme.typography.size.lg};
- margin: ${theme.spacing(0, 4, 0, 1)};
- display: flex;
- align-items: center;
- position: relative;
- top: 2px;
- `,
- modalHeaderIcon: css`
- margin-right: ${theme.spacing(2)};
- font-size: inherit;
- &:before {
- vertical-align: baseline;
- }
- `,
};
};