diff --git a/src/pages/Customers.tsx b/src/pages/Customers.tsx new file mode 100644 index 0000000..ab9eca6 --- /dev/null +++ b/src/pages/Customers.tsx @@ -0,0 +1,120 @@ +import { useState } from "react"; +import Sidebar from "@/components/Sidebar"; +import DashboardHeader from "@/components/DashboardHeader"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Input } from "@/components/ui/input"; +import { Button } from "@/components/ui/button"; +import { Badge } from "@/components/ui/badge"; +import { Avatar, AvatarFallback } from "@/components/ui/avatar"; +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; +import { Search } from "lucide-react"; + +const filters = ["All", "Active", "Trial", "Churned"]; + +const customers = [ + { name: "Sarah Chen", email: "sarah@acme.co", plan: "Enterprise", mrr: "\$299", joined: "Jan 12, 2024", status: "active", initials: "SC" }, + { name: "Marcus Johnson", email: "marcus@startup.io", plan: "Pro", mrr: "\$49", joined: "Feb 8, 2024", status: "active", initials: "MJ" }, + { name: "Emily Rivera", email: "emily@design.co", plan: "Pro", mrr: "\$49", joined: "Mar 15, 2024", status: "trial", initials: "ER" }, + { name: "David Kim", email: "david@tech.dev", plan: "Enterprise", mrr: "\$299", joined: "Apr 3, 2024", status: "active", initials: "DK" }, + { name: "Anna Petrov", email: "anna@agency.com", plan: "Free", mrr: "\$0", joined: "May 20, 2024", status: "churned", initials: "AP" }, + { name: "James Wright", email: "james@corp.biz", plan: "Pro", mrr: "\$49", joined: "Jun 1, 2024", status: "active", initials: "JW" }, + { name: "Lisa Nguyen", email: "lisa@creative.co", plan: "Enterprise", mrr: "\$299", joined: "Jul 14, 2024", status: "active", initials: "LN" }, + { name: "Tom Bradley", email: "tom@labs.io", plan: "Free", mrr: "\$0", joined: "Aug 22, 2024", status: "trial", initials: "TB" }, +]; + +export default function CustomersPage() { + const [activeFilter, setActiveFilter] = useState("All"); + const [search, setSearch] = useState(""); + + const filtered = customers.filter((c) => { + if (activeFilter !== "All" && c.status !== activeFilter.toLowerCase()) return false; + if (search && !c.name.toLowerCase().includes(search.toLowerCase()) && !c.email.toLowerCase().includes(search.toLowerCase())) return false; + return true; + }); + + return ( +
+ +
+ +
+ + + Customers + + + {/* Search & Filters */} +
+
+ + setSearch(e.target.value)} + className="pl-9" + /> +
+
+ {filters.map((f) => ( + + ))} +
+
+ + {/* Table */} + + + + Name + Plan + MRR + Joined + Status + + + + {filtered.map((c, i) => ( + + +
+ + {c.initials} + +
+

{c.name}

+

{c.email}

+
+
+
+ + + {c.plan} + + + {c.mrr} + {c.joined} + + + {c.status} + + +
+ ))} +
+
+ +

Showing {filtered.length} of {customers.length} customers

+
+
+
+
+
+ ); +}