mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-23 07:14:21 +00:00
🔧 Make AuthorizationRouter "return" the AuthorizationState instead of true
This commit is contained in:
parent
919cc3a4cb
commit
fbf371cd27
1 changed files with 3 additions and 3 deletions
|
@ -1,10 +1,10 @@
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import {useAuthorizationContext} from "../../contexts/authorization"
|
import {AuthorizationState, useAuthorizationContext} from "../../contexts/authorization"
|
||||||
import {useSophonPath} from "../../hooks/useSophonPath"
|
import {useSophonPath} from "../../hooks/useSophonPath"
|
||||||
import {ResourceRouter, ResourceRouterProps} from "../routing/ResourceRouter"
|
import {ResourceRouter, ResourceRouterProps} from "../routing/ResourceRouter"
|
||||||
|
|
||||||
|
|
||||||
export function AuthorizationRouter({...props}: ResourceRouterProps<true>): JSX.Element {
|
export function AuthorizationRouter({...props}: ResourceRouterProps<AuthorizationState>): JSX.Element {
|
||||||
const path = useSophonPath()
|
const path = useSophonPath()
|
||||||
const authorization = useAuthorizationContext()
|
const authorization = useAuthorizationContext()
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ export function AuthorizationRouter({...props}: ResourceRouterProps<true>): JSX.
|
||||||
return (
|
return (
|
||||||
<ResourceRouter
|
<ResourceRouter
|
||||||
{...props}
|
{...props}
|
||||||
selection={showDetails ? true : undefined}
|
selection={showDetails ? authorization?.state : undefined}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue