import { useMemo, useState } from 'react';
import { CircularProgress } from '@material-ui/core';
import { Warning } from '@material-ui/icons';
import { AppsLinkList, styles as commonStyles } from '../../common';
import SearchField from '../../common/SearchField/SearchField';
import PageContent from '../../common/PageContent/PageContent';
import HeaderTitle from '../../common/HeaderTitle';
import useApplications from '../../../hooks/api/getters/useApplications/useApplications';
import ConditionallyRender from '../../common/ConditionallyRender';
const ApplicationList = () => {
const { applications, loading } = useApplications();
const [filter, setFilter] = useState('');
const filteredApplications = useMemo(() => {
const regExp = new RegExp(filter, 'i');
return filter
? applications?.filter(a => regExp.test(a.appName))
: applications;
}, [applications, filter]);
const RenderNoApplications = () => (
<>
Oh snap, it does not seem like you have connected any
applications. To connect your application to Unleash you will
require a Client SDK.
You can read more about how to use Unleash in your application
in the{' '}
documentation.