import React from 'react'; import { useStore } from 'App/mstore'; import { numberWithCommas } from 'App/utils'; import { Step } from 'Components/UsabilityTesting/TestEdit'; import { Loader, NoContent, Pagination } from 'UI'; import { Button, Typography } from 'antd'; import { observer } from 'mobx-react-lite'; import { DownOutlined } from '@ant-design/icons'; const ResponsesOverview = observer(() => { const { uxtestingStore } = useStore(); const [page, setPage] = React.useState(1); const [showAll, setShowAll] = React.useState(false); const [taskId, setTaskId] = React.useState(uxtestingStore.instance?.tasks[0].taskId); React.useEffect(() => { // @ts-ignore uxtestingStore.fetchResponses(uxtestingStore.instance?.testId, taskId, page); }, [page, taskId]); const selectedIndex = uxtestingStore.instance?.tasks.findIndex((task) => task.taskId === taskId)!; const task = uxtestingStore.instance?.tasks.find((task) => task.taskId === taskId); return (
Open-ended task responses
Select Task / Question
} /> {showAll ? uxtestingStore.instance?.tasks .filter((t) => t.taskId !== taskId && t.allowTyping) .map((task) => (
setTaskId(task.taskId)}> t.taskId === task.taskId)!} title={task.title} description={task.description} />
)) : null}
# Response
Participant
Response (add search text)
No data yet} >
{uxtestingStore.responses[taskId!]?.list.map((r, i) => ( <>
{i + 10 * (page - 1) + 1}
{r.user_id || 'Anonymous User'}
{r.comment}
))}
Showing {(page - 1) * 10 + 1} to{' '} {(page - 1) * 10 + uxtestingStore.responses[taskId!]?.list.length} {' '} of{' '} {numberWithCommas(uxtestingStore.responses[taskId!]?.total)} {' '} replies.
setPage(p)} />
); }); export default ResponsesOverview;