ApiAuthorization.tsx27 lines · main
| 1 | import { ApiAuthorizationInvalidScreen } from './ApiAuthorization.Invalid' |
| 2 | import { ApiAuthorizationValidScreen } from './ApiAuthorization.Valid' |
| 3 | |
| 4 | export interface ApiAuthorizationScreenProps { |
| 5 | auth_id: string | undefined |
| 6 | organization_slug: string | undefined |
| 7 | navigate: (destination: string) => void |
| 8 | } |
| 9 | |
| 10 | export function ApiAuthorizationScreen({ |
| 11 | auth_id, |
| 12 | organization_slug, |
| 13 | navigate, |
| 14 | }: ApiAuthorizationScreenProps) { |
| 15 | const valid = !!auth_id |
| 16 | if (!valid) { |
| 17 | return <ApiAuthorizationInvalidScreen missingParameters={['auth_id']} /> |
| 18 | } |
| 19 | |
| 20 | return ( |
| 21 | <ApiAuthorizationValidScreen |
| 22 | auth_id={auth_id} |
| 23 | organization_slug={organization_slug} |
| 24 | navigate={navigate} |
| 25 | /> |
| 26 | ) |
| 27 | } |