ApiAuthorization.Error.tsx 987 B

12345678910111213141516171819202122232425262728
  1. import type { ReactNode } from 'react'
  2. import { Alert, AlertDescription, AlertTitle, Card, CardContent, CardHeader, WarningIcon } from 'ui'
  3. import type { ResourceError } from '@/data/api-authorization/api-authorization-query'
  4. export interface ApiAuthorizationErrorScreenProps {
  5. error: ResourceError | undefined
  6. }
  7. export function ApiAuthorizationErrorScreen({
  8. error,
  9. }: ApiAuthorizationErrorScreenProps): ReactNode {
  10. return (
  11. <Card>
  12. <CardHeader>Authorize API access</CardHeader>
  13. <CardContent className="p-0">
  14. <Alert variant="warning" className="border-0 rounded-t-none">
  15. <WarningIcon />
  16. <AlertTitle>Failed to fetch details for API authorization request</AlertTitle>
  17. <AlertDescription>
  18. <p>Please retry your authorization request from the requesting app</p>
  19. {error && <p className="mt-2">Error: {error?.message}</p>}
  20. </AlertDescription>
  21. </Alert>
  22. </CardContent>
  23. </Card>
  24. )
  25. }