9router/src/app/(dashboard)/dashboard/usage/page.js

37 lines
1,004 B
JavaScript
Raw Normal View History

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-31 00:58:04 -05:00
import { UsageStats, RequestLogger, CardSkeleton, SegmentedControl } from "@/shared/components";
2026-02-03 21:54:11 -05:00
import ProviderLimits from "./components/ProviderLimits";
2026-01-18 22:39:30 -05:00
export default function UsagePage() {
const [activeTab, setActiveTab] = useState("overview");
return (
<div className="flex flex-col gap-6">
2026-01-31 00:58:04 -05:00
<SegmentedControl
options={[
{ value: "overview", label: "Overview" },
{ value: "logs", label: "Logger" },
2026-02-03 21:54:11 -05:00
// { value: "limits", label: "Limits" },
2026-01-31 00:58:04 -05:00
]}
value={activeTab}
onChange={setActiveTab}
/>
2026-01-18 22:39:30 -05:00
{/* Content */}
2026-02-03 21:54:11 -05:00
{activeTab === "overview" && (
<Suspense fallback={<CardSkeleton />}>
<UsageStats />
</Suspense>
2026-02-03 21:54:11 -05:00
)}
{activeTab === "logs" && <RequestLogger />}
{activeTab === "limits" && (
<Suspense fallback={<CardSkeleton />}>
<ProviderLimits />
</Suspense>
)}
2026-01-18 22:39:30 -05:00
</div>
);
}