(matches?: UIMatch[])
| 8 | export type MatchedRun = UseDataFunctionReturn<typeof runLoader>["run"]; |
| 9 | |
| 10 | export function useOptionalRun(matches?: UIMatch[]) { |
| 11 | const project = useOptionalProject(matches); |
| 12 | const routeMatch = useTypedMatchesData<typeof runLoader>({ |
| 13 | id: "routes/_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.runs.$runParam", |
| 14 | matches, |
| 15 | }); |
| 16 | |
| 17 | if (!project || !routeMatch || !routeMatch.run) { |
| 18 | return undefined; |
| 19 | } |
| 20 | |
| 21 | return routeMatch.run; |
| 22 | } |
| 23 | |
| 24 | export function useRun(matches?: UIMatch[]) { |
| 25 | const run = useOptionalRun(matches); |
no test coverage detected
searching dependent graphs…