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.
68 lines
1.8 KiB
TypeScript
68 lines
1.8 KiB
TypeScript
import * as React from "react";
|
|
import {
|
|
Clapperboard,
|
|
Coins,
|
|
DollarSign,
|
|
Layers,
|
|
Timer,
|
|
TrendingDown,
|
|
} from "lucide-react";
|
|
import type { Insights } from "@/lib/types";
|
|
import { StatCard } from "./StatCard";
|
|
import { formatCount, formatDuration, formatUsd } from "./format";
|
|
|
|
export interface InsightsStatsProps {
|
|
insights: Readonly<Insights>;
|
|
}
|
|
|
|
/**
|
|
* The headline stat-card grid for the insights dashboard. Derives each already
|
|
* formatted metric from the caller-scoped {@link Insights} payload.
|
|
*/
|
|
export function InsightsStats({ insights }: Readonly<InsightsStatsProps>) {
|
|
return (
|
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
<StatCard
|
|
label="Jobs total"
|
|
value={formatCount(insights.jobs_total)}
|
|
icon={Layers}
|
|
accent="primary"
|
|
/>
|
|
<StatCard
|
|
label="Videos generated"
|
|
value={formatCount(insights.videos_generated)}
|
|
hint="Successfully rendered reels"
|
|
icon={Clapperboard}
|
|
accent="success"
|
|
/>
|
|
<StatCard
|
|
label="Credits balance"
|
|
value={formatCount(insights.credits_balance)}
|
|
hint={`${formatCount(insights.credits_spent)} spent to date`}
|
|
icon={Coins}
|
|
accent="accent"
|
|
/>
|
|
<StatCard
|
|
label="Credits spent"
|
|
value={formatCount(insights.credits_spent)}
|
|
icon={TrendingDown}
|
|
accent="destructive"
|
|
/>
|
|
<StatCard
|
|
label="Total cost"
|
|
value={formatUsd(insights.total_cost_usd)}
|
|
hint="Cumulative render spend"
|
|
icon={DollarSign}
|
|
accent="primary"
|
|
/>
|
|
<StatCard
|
|
label="Avg. render time"
|
|
value={formatDuration(insights.avg_render_ms)}
|
|
hint="Compose stage, per reel"
|
|
icon={Timer}
|
|
accent="accent"
|
|
/>
|
|
</div>
|
|
);
|
|
}
|