feat(admin): centralize subscriptions under /admin?tab=subscriptions
Replaced the dedicated /admin/subscriptions page with a redirect to the central admin panel’s subscriptions tab. Removed session checks, imports, and the AdminSubscriptionDashboard since routing and access are now handled centrally. This streamlines admin UX and keeps access control unified.
This commit is contained in:
1 parent
d8e7d5d7e6
commit
62ab5b2608
19 files changed
+3091
-357
No files matched your search
@@ -0,0 +1,74 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { AdminSubscriptionTab } from "@/components/admin/AdminSubscriptionTab";
|
||||
import { AdminItemManager, type AdminItemsResponse } from "@/components/admin/items/AdminItemManager";
|
||||
|
||||
interface AdminPanelTabsProps {
|
||||
adminUser: {
|
||||
subscription_tier?: {
|
||||
name: string;
|
||||
slug: string;
|
||||
} | null;
|
||||
username?: string;
|
||||
email?: string;
|
||||
} | null;
|
||||
initialTiers: any[];
|
||||
itemsData: AdminItemsResponse;
|
||||
initialTab?: "overview" | "subscriptions" | "items";
|
||||
}
|
||||
|
||||
export function AdminPanelTabs({
|
||||
adminUser,
|
||||
initialTiers,
|
||||
itemsData,
|
||||
initialTab = "overview",
|
||||
}: AdminPanelTabsProps) {
|
||||
const [activeTab, setActiveTab] = useState<"overview" | "subscriptions" | "items">(
|
||||
initialTab
|
||||
);
|
||||
|
||||
return (
|
||||
<Tabs
|
||||
value={activeTab}
|
||||
onValueChange={(value) => setActiveTab(value as typeof activeTab)}
|
||||
className="space-y-6"
|
||||
>
|
||||
<TabsList>
|
||||
<TabsTrigger value="overview">Visão Geral</TabsTrigger>
|
||||
<TabsTrigger value="subscriptions">Assinaturas & Permissões</TabsTrigger>
|
||||
<TabsTrigger value="items">Gerenciamento de Itens</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="overview" className="space-y-4">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Bem-vindo, {adminUser?.username ?? "Administrador"}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3 text-sm text-muted-foreground">
|
||||
<p>
|
||||
Utilize as abas acima para administrar planos de assinatura, permissões
|
||||
e a curadoria de itens do marketplace. Esta área é exclusiva para
|
||||
operadores autorizados.
|
||||
</p>
|
||||
<p>
|
||||
Para solicitações críticas, lembre-se de registrar mudanças e validar
|
||||
com a equipe responsável antes de disponibilizar aos usuários finais.
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="subscriptions">
|
||||
<AdminSubscriptionTab initialTiers={initialTiers} adminUser={adminUser} />
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="items">
|
||||
<AdminItemManager initialData={itemsData} />
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user