({ children, fallback }: React.PropsWithChildren<{ fallback: JSX.Element }>)
| 13 | } |
| 14 | |
| 15 | export const AuthWrapper = ({ children, fallback }: React.PropsWithChildren<{ fallback: JSX.Element }>): JSX.Element => { |
| 16 | const { data: signInCheckResult } = useSigninCheck(); |
| 17 | |
| 18 | if (!children) { |
| 19 | throw new Error('Children must be provided'); |
| 20 | } |
| 21 | |
| 22 | if (signInCheckResult.signedIn === true) { |
| 23 | return children as JSX.Element; |
| 24 | } else { |
| 25 | return fallback; |
| 26 | } |
| 27 | }; |
| 28 | |
| 29 | const UserDetails = () => { |
| 30 | const auth = useAuth(); |
nothing calls this directly
no test coverage detected