import React, { useCallback, useEffect, useState } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import { Project as ProjectType } from 'gql-client'; import { Button, Typography } from '@material-tailwind/react'; import HorizontalLine from '../../components/HorizontalLine'; import ProjectTabs from '../../components/projects/project/ProjectTabs'; import { useGQLClient } from '../../context/GQLClientContext'; const Id = () => { const { id } = useParams(); const navigate = useNavigate(); const client = useGQLClient(); const [project, setProject] = useState(null); const fetchProject = useCallback(async (id: string | undefined) => { if (id) { const { project } = await client.getProject(id); setProject(project); } }, []); useEffect(() => { fetchProject(id); }, [id]); const onUpdate = async () => { await fetchProject(id); }; return (
{project ? ( <>
{project?.name}
) : (

Project not found

)}
); }; export default Id;