import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; import CircularProgress from '@mui/material/CircularProgress'; import Stack from '@mui/material/Stack'; import Card from '@mui/material/Card'; import CardActionArea from '@mui/material/CardActionArea'; 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 useAdminAppAuthClients from 'hooks/useAdminAppAuthClients'; import NoResultFound from 'components/NoResultFound'; function AdminApplicationAuthClients(props) { const { appKey } = props; const formatMessage = useFormatMessage(); const { data: appAuthClients, isLoading } = useAdminAppAuthClients(appKey); if (isLoading) return ; if (!appAuthClients?.data.length) { return ( ); } const sortedAuthClients = appAuthClients.data.slice().sort((a, b) => { if (a.id < b.id) { return -1; } if (a.id > b.id) { return 1; } return 0; }); return (
{sortedAuthClients.map((client) => ( {client.name} ))}
); } AdminApplicationAuthClients.propTypes = { appKey: PropTypes.string.isRequired, }; export default AdminApplicationAuthClients;