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.
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
/**
|
|
* Maps live hub signals onto specific nav rows so advanced surfaces advertise
|
|
* what is waiting behind them (e.g. Notifications shows the unread count, the
|
|
* Task Queue shows how many jobs are running). Pure: given the data, returns
|
|
* the badge to render for a route, or null.
|
|
*/
|
|
|
|
import type { BadgeVariant } from "@/components/ui/Badge";
|
|
import type { NavHubData } from "./useNavHubData";
|
|
|
|
export interface RowBadge {
|
|
label: string;
|
|
variant: BadgeVariant;
|
|
}
|
|
|
|
export function badgeForRoute(
|
|
route: string,
|
|
data: NavHubData,
|
|
): RowBadge | null {
|
|
switch (route) {
|
|
case "/notifications":
|
|
return data.unread && data.unread > 0
|
|
? { label: `${data.unread} new`, variant: "accent" }
|
|
: null;
|
|
case "/jobs/reels/tasks":
|
|
return data.activeJobs && data.activeJobs > 0
|
|
? { label: `${data.activeJobs} running`, variant: "success" }
|
|
: null;
|
|
case "/wallet":
|
|
return typeof data.credits === "number"
|
|
? { label: `${data.credits} cr`, variant: "neutral" }
|
|
: null;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|