({
activeProject,
setActiveProject,
}: {
activeProject: string
setActiveProject: (activeProject: string | null) => void
})
| 4 | import Spinner from './Spinner' |
| 5 | |
| 6 | export default function Project({ |
| 7 | activeProject, |
| 8 | setActiveProject, |
| 9 | }: { |
| 10 | activeProject: string |
| 11 | setActiveProject: (activeProject: string | null) => void |
| 12 | }) { |
| 13 | const { data, isFetching } = useSuspenseQuery( |
| 14 | projectsQueries.detail(activeProject), |
| 15 | ) |
| 16 | |
| 17 | return ( |
| 18 | <div> |
| 19 | <Button onClick={() => setActiveProject(null)}>Back</Button> |
| 20 | <h1> |
| 21 | {activeProject} {isFetching ? <Spinner /> : null} |
| 22 | </h1> |
| 23 | <div> |
| 24 | <p>forks: {data.forks_count}</p> |
| 25 | <p>stars: {data.stargazers_count}</p> |
| 26 | <p>watchers: {data.subscribers_count}</p> |
| 27 | </div> |
| 28 | <br /> |
| 29 | <br /> |
| 30 | </div> |
| 31 | ) |
| 32 | } |
nothing calls this directly
no test coverage detected