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.
62 lines
2.0 KiB
TypeScript
62 lines
2.0 KiB
TypeScript
"use client";
|
|
|
|
import * as React from "react";
|
|
import Link from "next/link";
|
|
import { usePathname } from "next/navigation";
|
|
import { BarChart3, Gift, LineChart, Package } from "lucide-react";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
interface NavItem {
|
|
readonly href: string;
|
|
readonly label: string;
|
|
readonly icon: React.ComponentType<{ className?: string }>;
|
|
}
|
|
|
|
/** The Growth-area sub-navigation shown across every /insights surface. */
|
|
const ITEMS: readonly NavItem[] = [
|
|
{ href: "/insights", label: "Overview", icon: BarChart3 },
|
|
{ href: "/insights/analytics", label: "Analytics", icon: LineChart },
|
|
{ href: "/insights/referral", label: "Referrals", icon: Gift },
|
|
{ href: "/insights/presets", label: "Brand kits", icon: Package },
|
|
];
|
|
|
|
/**
|
|
* Tab-style sub-navigation for the Growth center. Highlights the current route
|
|
* (exact match for the overview, prefix match for the deeper sections) so the
|
|
* disconnected analytics / referral / preset pages read as one area.
|
|
*/
|
|
export function InsightsNav() {
|
|
const pathname = usePathname();
|
|
|
|
return (
|
|
<nav
|
|
aria-label="Growth sections"
|
|
className="mb-6 flex flex-wrap gap-1 border-b border-border"
|
|
>
|
|
{ITEMS.map((item) => {
|
|
const isActive =
|
|
item.href === "/insights"
|
|
? pathname === "/insights"
|
|
: pathname === item.href || pathname.startsWith(`${item.href}/`);
|
|
const Icon = item.icon;
|
|
return (
|
|
<Link
|
|
key={item.href}
|
|
href={item.href}
|
|
aria-current={isActive ? "page" : undefined}
|
|
className={cn(
|
|
"-mb-px inline-flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm font-medium transition-colors",
|
|
isActive
|
|
? "border-primary text-foreground"
|
|
: "border-transparent text-muted-foreground hover:text-foreground",
|
|
)}
|
|
>
|
|
<Icon className="size-4" />
|
|
{item.label}
|
|
</Link>
|
|
);
|
|
})}
|
|
</nav>
|
|
);
|
|
}
|