1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-28 17:55:15 +02:00
unleash.unleash/frontend/src/component/admin/apiToken/ConfirmToken/ConfirmToken.tsx
Nuno Góis 4167a60588
feat: biome lint frontend (#4903)
Follows up on https://github.com/Unleash/unleash/pull/4853 to add Biome
to the frontend as well.


![image](https://github.com/Unleash/unleash/assets/14320932/1906faf1-fc29-4172-a4d4-b2716d72cd65)

Added a few `biome-ignore` to speed up the process but we may want to
check and fix them in the future.
2023-10-02 13:25:46 +01:00

52 lines
1.6 KiB
TypeScript

import { Alert, Typography } from '@mui/material';
import { Link } from 'react-router-dom';
import { Dialogue } from 'component/common/Dialogue/Dialogue';
import { UserToken } from './UserToken/UserToken';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { TokenType } from 'interfaces/token';
interface IConfirmUserLink {
open: boolean;
setOpen: (status: boolean) => void;
closeConfirm: () => void;
token: string;
type?: string;
}
export const ConfirmToken = ({
open,
setOpen,
closeConfirm,
token,
type,
}: IConfirmUserLink) => {
return (
<Dialogue
open={open}
setOpen={setOpen}
onClick={closeConfirm}
primaryButtonText='Close'
title='New token created'
>
<Typography variant='body1'>
Your new token has been created successfully.
</Typography>
<UserToken token={token} />
<ConditionallyRender
condition={type === TokenType.FRONTEND}
show={
<Alert sx={{ mt: 2 }} severity='info'>
By default, all {TokenType.FRONTEND} tokens may be used
from any CORS origin. If you'd like to configure a
strict set of origins, please use the{' '}
<Link to='/admin/cors' target='_blank' rel='noreferrer'>
CORS origins configuration page
</Link>
.
</Alert>
}
/>
</Dialogue>
);
};