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

36 lines
1004 B
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";
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" },
2026-02-04 09:54:11 +07:00
// { value: "limits", label: "Limits" },
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>
)}
2026-01-19 10:39:30 +07:00
</div>
);
}