refactor(web): remove typescript
This commit is contained in:
@@ -7,27 +7,16 @@ import CardContent from '@mui/material/CardContent';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import Chip from '@mui/material/Chip';
|
||||
import Button from '@mui/material/Button';
|
||||
|
||||
import * as URLS from 'config/urls';
|
||||
import useFormatMessage from 'hooks/useFormatMessage';
|
||||
import useAppAuthClients from 'hooks/useAppAuthClients.ee';
|
||||
|
||||
import NoResultFound from 'components/NoResultFound';
|
||||
|
||||
type AdminApplicationAuthClientsProps = {
|
||||
appKey: string;
|
||||
};
|
||||
|
||||
function AdminApplicationAuthClients(
|
||||
props: AdminApplicationAuthClientsProps
|
||||
): React.ReactElement {
|
||||
function AdminApplicationAuthClients(props) {
|
||||
const { appKey } = props;
|
||||
const formatMessage = useFormatMessage();
|
||||
const { appAuthClients, loading } = useAppAuthClients({ appKey });
|
||||
|
||||
if (loading)
|
||||
return <CircularProgress sx={{ display: 'block', margin: '20px auto' }} />;
|
||||
|
||||
if (!appAuthClients?.length) {
|
||||
return (
|
||||
<NoResultFound
|
||||
@@ -36,7 +25,6 @@ function AdminApplicationAuthClients(
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const sortedAuthClients = appAuthClients.slice().sort((a, b) => {
|
||||
if (a.id < b.id) {
|
||||
return -1;
|
||||
@@ -46,7 +34,6 @@ function AdminApplicationAuthClients(
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
{sortedAuthClients.map((client) => (
|
||||
@@ -67,7 +54,7 @@ function AdminApplicationAuthClients(
|
||||
label={formatMessage(
|
||||
client?.active
|
||||
? 'adminAppsAuthClients.statusActive'
|
||||
: 'adminAppsAuthClients.statusInactive'
|
||||
: 'adminAppsAuthClients.statusInactive',
|
||||
)}
|
||||
/>
|
||||
</Stack>
|
||||
@@ -85,5 +72,4 @@ function AdminApplicationAuthClients(
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default AdminApplicationAuthClients;
|
Reference in New Issue
Block a user