import { Button, Column, getMaterialColors, LinearProgressIndicator, Text, } from "@expo/ui/jetpack-compose"; import { fillMaxSize, fillMaxWidth, height, padding, paddingAll, } from "@expo/ui/jetpack-compose/modifiers"; import { createWidget, type WidgetEnvironment } from "expo-widgets"; import type { SubscriptionUsageSnapshot as SubscriptionUsageProps } from "./subscriptionUsageSnapshot"; export function SubscriptionUsage(props: SubscriptionUsageProps, environment: WidgetEnvironment) { "widget"; // The widget runtime evaluates this function without the app's module scope. // Android has no timeline, so freshness is decided on every render; the // expiry alarm and each tap trigger one while the app is closed. const now = Date.now(); // The 4x3 default cell fits two quotas per provider with their reset text. const limit = 2; const colors = getMaterialColors({ scheme: environment.colorScheme === "dark" ? "dark" : "light", }); const muted = colors.onSurfaceVariant; const providers = props.providers ?? [ { name: "Codex", detail: "Open T3 to connect", windows: [], expiresAt: 0, totalWindows: 0 }, { name: "Claude", detail: "Open T3 to connect", windows: [], expiresAt: 0, totalWindows: 0 }, ]; return ( // The card is one Button so a tap reaches the app's interaction listener, // which opens props.url. expo-widgets has no Android counterpart to widgetURL. ); } export default createWidget("SubscriptionUsage", SubscriptionUsage);