import React from 'react' import { Link } from "react-router-dom" import { useQuery } from '@wasp/queries' import getTask from '@wasp/queries/getTask.js' const Todo = (props) => { const { data: task, isFetching, isError } = useQuery(getTask, { id: parseInt(props.match.params.id) }) if (!task) { return (
Task with id {props.match.params.id} does not exist.
) } if (isError) { return (
Error occurred!
) } return ( <> { isFetching ? (
Fetching task ...
) : ( <>

Task

id: {task.id}
description: {task.description}
is done: {task.isDone ? 'Yes' : 'No'}
)}
Go to dashboard ) } export default Todo