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

39 lines
1.1 KiB
JavaScript
Raw Normal View History

2026-01-19 10:39:30 +07:00
"use client";
2026-01-19 23:01:39 +07:00
import { useState, Suspense } from "react";
2026-01-31 12:58:04 +07:00
import { UsageStats, RequestLogger, CardSkeleton, SegmentedControl } from "@/shared/components";
2026-02-04 09:54:11 +07:00
import ProviderLimits from "./components/ProviderLimits";
import RequestDetailsTab from "./components/RequestDetailsTab";
2026-01-19 10:39:30 +07:00
export default function UsagePage() {
const [activeTab, setActiveTab] = useState("overview");
return (
<div className="flex flex-col gap-6">
2026-01-31 12:58:04 +07:00
<SegmentedControl
options={[
{ value: "overview", label: "Overview" },
{ value: "logs", label: "Logger" },
{ value: "limits", label: "Limits" },
{ value: "details", label: "Details" },
2026-01-31 12:58:04 +07:00
]}
value={activeTab}
onChange={setActiveTab}
/>
2026-01-19 10:39:30 +07:00
{/* Content */}
2026-02-04 09:54:11 +07:00
{activeTab === "overview" && (
<Suspense fallback={<CardSkeleton />}>
<UsageStats />
</Suspense>
2026-02-04 09:54:11 +07:00
)}
{activeTab === "logs" && <RequestLogger />}
{activeTab === "limits" && (
<Suspense fallback={<CardSkeleton />}>
<ProviderLimits />
</Suspense>
)}
{activeTab === "details" && <RequestDetailsTab />}
2026-01-19 10:39:30 +07:00
</div>
);
}