import { seedDemoData, clearDemoData, setTestPlan } from "@/app/actions/seed-demo" import { eq } from "drizzle-orm" import { db } from "@/lib/db" import { profiles } from "@/lib/db/schema" import { getSessionUser } from "@/lib/session" import { redirect, notFound } from "next/navigation" import { Building2, Users, CreditCard, Wrench, FileText, Receipt, Sparkles, Trash2, CheckCircle2, Zap, Crown, Infinity } from "lucide-react" const DEMO_CONTENTS = [ { icon: Building2, color: "text-indigo-400 bg-indigo-500/10", label: "3 Properties", detail: "Maple Court, Riverdale Flats, Crestwood Villa" }, { icon: Building2, color: "text-violet-400 bg-violet-500/10", label: "7 Units", detail: "Mix of 1, 2 & 3-bedroom units across all properties" }, { icon: Users, color: "text-blue-400 bg-blue-500/10", label: "6 Tenants", detail: "Sarah, Marcus, Priya, David, Emily & James — with contacts" }, { icon: FileText, color: "text-emerald-400 bg-emerald-500/10", label: "6 Leases", detail: "Active leases, 2 expiring soon to trigger alerts" }, { icon: CreditCard, color: "text-teal-400 bg-teal-500/10", label: "30+ Payments", detail: "6 months of history — paid, pending & overdue statuses" }, { icon: Wrench, color: "text-amber-400 bg-amber-500/10", label: "6 Maintenance Requests", detail: "Open, in-progress & resolved — with priorities" }, { icon: Receipt, color: "text-rose-400 bg-rose-500/10", label: "8 Expenses", detail: "Repairs, insurance, utilities, taxes — with vendors" }, ] const PLANS = [ { value: "starter", label: "Starter", icon: Zap, color: "text-white/60 border-white/10 hover:border-white/20", desc: "Free — no AI" }, { value: "pro", label: "Pro", icon: Sparkles, color: "text-indigo-300 border-indigo-500/30 hover:border-indigo-500/60 bg-indigo-500/5", desc: "50 AI calls/mo" }, { value: "landlord", label: "Landlord", icon: Crown, color: "text-violet-300 border-violet-500/30 hover:border-violet-500/60 bg-violet-500/5", desc: "200 AI calls/mo" }, { value: "lifetime", label: "Lifetime", icon: Infinity, color: "text-amber-300 border-amber-500/30 hover:border-amber-500/60 bg-amber-500/5", desc: "Unlimited — all features" }, ] as const export default async function DemoDataPage() { const user = await getSessionUser() if (!user) redirect("/login") if (process.env.NODE_ENV === "production") notFound() const profile = await db.query.profiles.findFirst({ where: eq(profiles.id, user.id), columns: { plan: true }, }) const currentPlan = profile?.plan ?? "starter" return (
Test Plan
Switch plans instantly to test different features — current: {currentPlan}
For testing only — does not affect real billing
Demo Data
Populate your account with realistic sample data
{item.label}
{item.detail}
Note: "Load demo data" adds records to your account. Use "Clear all data" to wipe everything when done testing.