2026-01-18 22:39:30 -05:00
|
|
|
"use client";
|
|
|
|
|
|
2026-01-19 11:01:39 -05:00
|
|
|
import { useState, Suspense } from "react";
|
2026-01-18 22:39:30 -05:00
|
|
|
import { UsageStats, RequestLogger } from "@/shared/components";
|
|
|
|
|
|
|
|
|
|
export default function UsagePage() {
|
|
|
|
|
const [activeTab, setActiveTab] = useState("overview");
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex flex-col gap-6">
|
|
|
|
|
{/* Tabs */}
|
|
|
|
|
<div className="flex border-b border-border">
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => setActiveTab("overview")}
|
|
|
|
|
className={`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${
|
|
|
|
|
activeTab === "overview"
|
|
|
|
|
? "border-primary text-primary"
|
|
|
|
|
: "border-transparent text-text-muted hover:text-text-primary"
|
|
|
|
|
}`}
|
|
|
|
|
>
|
|
|
|
|
Overview
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => setActiveTab("logs")}
|
|
|
|
|
className={`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${
|
|
|
|
|
activeTab === "logs"
|
|
|
|
|
? "border-primary text-primary"
|
|
|
|
|
: "border-transparent text-text-muted hover:text-text-primary"
|
|
|
|
|
}`}
|
|
|
|
|
>
|
|
|
|
|
Logger
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Content */}
|
2026-01-19 11:01:39 -05:00
|
|
|
<Suspense fallback={<div className="text-text-muted">Loading...</div>}>
|
|
|
|
|
{activeTab === "overview" ? <UsageStats /> : <RequestLogger />}
|
|
|
|
|
</Suspense>
|
2026-01-18 22:39:30 -05:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|