import { createClient } from '@/lib/supabase/server'; import { redirect } from 'next/navigation'; import { checkIsAdmin } from '@/services/track-api-usage'; import { getAllPlans } from '@/services/subscription-service'; import Link from 'next/link'; import { ChevronLeft, Package } from 'lucide-react'; import PlanManagementClient from '@/components/PlanManagementClient'; export default async function AdminPlansPage() { const supabase = await createClient(); const { data: { user } } = await supabase.auth.getUser(); if (!user) { redirect('/'); } const isAdmin = await checkIsAdmin(user.id); if (!isAdmin) { redirect('/'); } // Fetch all plans const plans = await getAllPlans(); return (
{/* Header */}
Back to Dashboard

Subscription Plans

Manage subscription tiers and monthly credits

{/* Plan Management */}
); }