import { ScrollView, View, Text, TouchableOpacity, ActivityIndicator, RefreshControl, } from "react-native"; import { SafeAreaView } from "react-native-safe-area-context"; import { MaterialIcons } from "@expo/vector-icons"; import { useCodexUsage } from "@/hooks/useCodexUsage"; import { UsageStat } from "@/components/UsageStat"; import { ErrorMessage } from "@/components/ErrorMessage"; import { windowLabel } from "@/lib/timeUtils"; export default function CodexTab() { const { auth, usage, status, error, importAuthFile, refresh, clearAuth } = useCodexUsage(); return ( } > {/* Header */} Codex CLI Rate limits & credits {/* Configuration card */} Configuration {auth ? ( Connected {auth.accountId && ( {auth.accountId.slice(0, 10)}… )} Clear ) : ( Import auth.json Located at ~/.codex/auth.json )} {/* Usage card */} Usage {status === "idle" && !auth && ( Import auth.json to see your rate limits )} {status === "loading" && ( )} {status === "error" && error && } {status === "success" && usage && ( {/* Plan badge */} {usage.plan_type} {/* Credits */} Credits {usage.credits.unlimited ? ( Unlimited ) : usage.credits.has_credits ? ( ${Number(usage.credits.balance).toFixed(2)} remaining ) : ( No credits )} )} ); }