import { UxTest, UxTListEntry } from "App/services/UxtestingService"; import React from 'react'; import { observer } from 'mobx-react-lite'; import { useStore } from 'App/mstore'; import { numberWithCommas } from 'App/utils'; import { Button, Input, Typography, Tag, Avatar, Modal, Space } from 'antd'; import AnimatedSVG from 'Shared/AnimatedSVG'; import { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG'; import { Loader, NoContent, Pagination, Link } from 'UI'; import { checkForRecent, getDateFromMill } from 'App/date'; import { UnorderedListOutlined, ArrowRightOutlined } from '@ant-design/icons'; import { useHistory, useParams } from 'react-router-dom'; import { withSiteId, usabilityTestingEdit, usabilityTestingView } from 'App/routes'; import { debounce } from 'App/utils'; import withPageTitle from 'HOCs/withPageTitle'; const { Search } = Input; const PER_PAGE = 10; let debouncedSearch: any = () => null const defaultDescription = `To evaluate the usability of [Feature Name], focusing on user interaction, efficiency, and satisfaction. The aim is to identify any usability issues that users may encounter, understand how they navigate [Feature Name], and gauge the intuitiveness of the workflow.` function TestsTable() { const [newTestTitle, setNewTestTitle] = React.useState(''); const [newTestDescription, setNewTestDescription] = React.useState(defaultDescription); const [isModalVisible, setIsModalVisible] = React.useState(false); const { uxtestingStore } = useStore(); const onSearch = (value: string) => { uxtestingStore.setQuery(value); debouncedSearch() } React.useEffect(() => { uxtestingStore.getList(); debouncedSearch = debounce(uxtestingStore.getList, 500) }, []); const onPageChange = (page: number) => { uxtestingStore.setPage(page); uxtestingStore.getList(); }; // @ts-ignore const { siteId } = useParams(); const history = useHistory(); const onClose = (confirmed: boolean) => { if (confirmed) { uxtestingStore.initNewTest(newTestTitle, newTestDescription); setNewTestDescription(''); setNewTestTitle(''); redirect('new'); } setIsModalVisible(false); }; const openModal = () => { setIsModalVisible(true); }; const redirect = (path: string) => { history.push(withSiteId(usabilityTestingEdit(path), siteId)); }; return (