Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Paid, hosted product at menivor.com, now retired as a company project. Fresh squashed history of the cleaned working tree (secret-scanned, no .env, no customer data, no outreach logs). Built on MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
66 lines
2.1 KiB
TypeScript
66 lines
2.1 KiB
TypeScript
/**
|
|
* NavSummary — the live activity strip at the top of the navigation hub.
|
|
* Renders credits, active jobs and unread notifications as StatTiles, each
|
|
* tappable to jump to the relevant surface. Shows a loading skeleton on first
|
|
* load and a compact error with retry when every signal failed.
|
|
*/
|
|
|
|
import { Pressable, StyleSheet, View } from "react-native";
|
|
|
|
import { ErrorState } from "@/components/ui/ErrorState";
|
|
import { Skeleton } from "@/components/ui/Loading";
|
|
import { StatTile } from "@/components/ui/StatTile";
|
|
import { spacing } from "@/src/shared/theme";
|
|
import type { NavHubState } from "@/lib/nav/useNavHubData";
|
|
|
|
export interface NavSummaryProps {
|
|
state: NavHubState;
|
|
onOpen: (route: string) => void;
|
|
}
|
|
|
|
function tileValue(n: number | undefined): string {
|
|
return typeof n === "number" ? String(n) : "—";
|
|
}
|
|
|
|
export function NavSummary({ state, onOpen }: NavSummaryProps): React.JSX.Element {
|
|
const { data, loading, error, reload } = state;
|
|
|
|
if (loading) {
|
|
return (
|
|
<View style={styles.row}>
|
|
<Skeleton height={64} style={styles.skeleton} />
|
|
<Skeleton height={64} style={styles.skeleton} />
|
|
<Skeleton height={64} style={styles.skeleton} />
|
|
</View>
|
|
);
|
|
}
|
|
|
|
if (error) {
|
|
return <ErrorState message={error} onRetry={reload} retryLabel="Retry" />;
|
|
}
|
|
|
|
return (
|
|
<View style={styles.row}>
|
|
<Pressable style={styles.cell} onPress={() => onOpen("/wallet")}>
|
|
<StatTile label="Credits" value={tileValue(data.credits)} subLabel="Wallet" />
|
|
</Pressable>
|
|
<Pressable style={styles.cell} onPress={() => onOpen("/jobs/reels/tasks")}>
|
|
<StatTile
|
|
label="Active jobs"
|
|
value={tileValue(data.activeJobs)}
|
|
subLabel="Queue"
|
|
/>
|
|
</Pressable>
|
|
<Pressable style={styles.cell} onPress={() => onOpen("/notifications")}>
|
|
<StatTile label="Unread" value={tileValue(data.unread)} subLabel="Alerts" />
|
|
</Pressable>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
row: { flexDirection: "row", gap: spacing.sm },
|
|
cell: { flex: 1 },
|
|
skeleton: { flex: 1, borderRadius: 10 },
|
|
});
|