import React from "react"; import { ScrollView } from "react-native"; import { SafeAreaView } from "react-native-safe-area-context"; import { StatusBar } from "expo-status-bar"; import { useColorScheme } from "nativewind"; import { MutedText } from "../../components/text"; import { Button } from "../../components/button"; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "../../components/card"; export interface ErrorScreenProps { /** Machine error code (e.g. `unknown_client`), shown for support/debugging. */ code?: string; title?: string; message?: string; /** Optional retry action. */ onRetry?: () => void; /** Optional "back to safety" action (e.g. home / sign-in). */ onHome?: () => void; homeLabel?: string; } /** * Polished terminal error screen for the auth surfaces (a failed authorize, an * unexpected server error, …). Presentational; the host app maps codes to * copy and wires the actions. */ export function ErrorScreen({ code, title = "Something went wrong", message = "We couldn't complete that request. Please try again.", onRetry, onHome, homeLabel = "Back to sign in", }: ErrorScreenProps) { const { colorScheme } = useColorScheme(); const isDark = colorScheme === "dark"; return ( {title} {message} {code ? ( code: {code} ) : null} {onRetry || onHome ? ( {onRetry ? ( ) : null} {onHome ? ( ) : null} ) : null} ); } export default ErrorScreen;