mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-23 15:24:21 +00:00
25 lines
786 B
TypeScript
25 lines
786 B
TypeScript
|
import * as React from "react"
|
||
|
import {useManagedViewSet} from "../../hooks/useManagedViewSet"
|
||
|
import {Dict} from "../../types/ExtraTypes"
|
||
|
import {SophonResearchProject} from "../../types/SophonTypes"
|
||
|
import {ViewSetRouter} from "../routing/ViewSetRouter"
|
||
|
|
||
|
|
||
|
export interface ProjectRouterProps {
|
||
|
groupPk: string,
|
||
|
unselectedRoute: (props: Dict<any>) => JSX.Element | null,
|
||
|
selectedRoute: (props: Dict<any>) => JSX.Element | null,
|
||
|
}
|
||
|
|
||
|
|
||
|
export function ProjectRouter({groupPk, ...props}: ProjectRouterProps): JSX.Element {
|
||
|
return (
|
||
|
<ViewSetRouter
|
||
|
{...props}
|
||
|
viewSet={useManagedViewSet<SophonResearchProject>(`/api/projects/by-group/${groupPk}`, "slug")}
|
||
|
pathSegment={"researchGroup"}
|
||
|
pkKey={"slug"}
|
||
|
/>
|
||
|
)
|
||
|
}
|