refactor(web): remove typescript
This commit is contained in:
@@ -5,33 +5,22 @@ import ListItem from '@mui/material/ListItem';
|
||||
import ListItemButton from '@mui/material/ListItemButton';
|
||||
import ListItemText from '@mui/material/ListItemText';
|
||||
import * as React from 'react';
|
||||
|
||||
import useAppAuthClients from 'hooks/useAppAuthClients.ee';
|
||||
import useFormatMessage from 'hooks/useFormatMessage';
|
||||
|
||||
type AppAuthClientsDialogProps = {
|
||||
appKey: string;
|
||||
onClientClick: (appAuthClientId: string) => void;
|
||||
onClose: () => void;
|
||||
};
|
||||
|
||||
export default function AppAuthClientsDialog(props: AppAuthClientsDialogProps) {
|
||||
export default function AppAuthClientsDialog(props) {
|
||||
const { appKey, onClientClick, onClose } = props;
|
||||
const { appAuthClients } = useAppAuthClients({ appKey, active: true });
|
||||
const formatMessage = useFormatMessage();
|
||||
|
||||
React.useEffect(
|
||||
function autoAuthenticateSingleClient() {
|
||||
if (appAuthClients?.length === 1) {
|
||||
onClientClick(appAuthClients[0].id);
|
||||
}
|
||||
},
|
||||
[appAuthClients]
|
||||
[appAuthClients],
|
||||
);
|
||||
|
||||
if (!appAuthClients?.length || appAuthClients?.length === 1)
|
||||
return <React.Fragment />;
|
||||
|
||||
return (
|
||||
<Dialog onClose={onClose} open={true}>
|
||||
<DialogTitle>{formatMessage('appAuthClientsDialog.title')}</DialogTitle>
|
Reference in New Issue
Block a user