import React from 'react'; import { useStore } from 'App/mstore'; import { numberWithCommas } from 'App/utils'; import { Input } from 'antd'; import ReloadButton from 'Shared/ReloadButton'; import SessionItem from 'Shared/SessionItem'; import { Loader, Pagination } from 'UI'; import { observer } from 'mobx-react-lite'; function LiveTestsModal({ testId, closeModal }: { testId: string; closeModal: () => void }) { const [page, setPage] = React.useState(1); const [isLoading, setIsLoading] = React.useState(false); const [userId, setUserId] = React.useState(''); const { uxtestingStore } = useStore(); React.useEffect(() => { uxtestingStore.getAssistSessions(testId, page, undefined); }, []); const refreshData = (page: number) => { setIsLoading(true); setPage(page); uxtestingStore .getAssistSessions(testId, page, userId) .then(() => setIsLoading(false)) .catch(() => setIsLoading(false)); }; return (
refreshData(page)} />
Live Participants
setUserId(e.target.value)} onSearch={() => refreshData(page)} />
{uxtestingStore.testAssistSessions.list.map((s: any) => ( ))}
Showing {(page - 1) * 10 + 1} to{' '} {(page - 1) * 10 + uxtestingStore.testAssistSessions.list.length} {' '} of{' '} {numberWithCommas(uxtestingStore.testAssistSessions.total)} {' '} ongoing tests.
); } export default observer(LiveTestsModal);