feat(mission-control): add BackToMC button to all pages
- Created BackToMC component - Added to all 27 mission control pages - Each page now has '← Back to Mission Control' button at top - Also pushed beta to develop to sync branches
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import BackToMC from "@/components/mission-control/BackToMC";
|
||||
import { useState } from "react";
|
||||
|
||||
const LEAD_STATUSES = ["all", "new", "contacted", "qualified", "proposal", "won", "lost"];
|
||||
|
||||
const SAMPLE_LEADS = [
|
||||
{ id: 1, name: "Restaurante El Galeón", email: "info@galeon.es", phone: "+34 952 123 456", status: "qualified", source: "Website" },
|
||||
{ id: 2, name: "Clínica Dental Mar", email: "contacto@clinica-dental-mar.es", phone: "+34 951 234 567", status: "contacted", source: "Referral" },
|
||||
@@ -12,77 +11,49 @@ const SAMPLE_LEADS = [
|
||||
|
||||
export default function LeadsPage() {
|
||||
const [filter, setFilter] = useState("all");
|
||||
|
||||
const filteredLeads = filter === "all"
|
||||
? SAMPLE_LEADS
|
||||
: SAMPLE_LEADS.filter(l => l.status === filter);
|
||||
|
||||
const filteredLeads = filter === "all" ? SAMPLE_LEADS : SAMPLE_LEADS.filter(l => l.status === filter);
|
||||
const statusColors: Record<string, string> = {
|
||||
new: "bg-blue-500/20 text-blue-400",
|
||||
contacted: "bg-yellow-500/20 text-yellow-400",
|
||||
qualified: "bg-green-500/20 text-green-400",
|
||||
proposal: "bg-purple-500/20 text-purple-400",
|
||||
won: "bg-emerald-500/20 text-emerald-400",
|
||||
lost: "bg-red-500/20 text-red-400",
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<div className="mb-6">
|
||||
<h1 className="text-3xl font-bold text-white mb-2">📋 Lead Manager</h1>
|
||||
<p className="text-slate-400">Manage your SiteMente leads</p>
|
||||
</div>
|
||||
|
||||
{/* Filters */}
|
||||
<div className="flex gap-2 mb-6 flex-wrap">
|
||||
{LEAD_STATUSES.map(status => (
|
||||
<button
|
||||
key={status}
|
||||
onClick={() => setFilter(status)}
|
||||
className={`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${
|
||||
filter === status
|
||||
? "bg-brand-pink text-white"
|
||||
: "bg-slate-800 text-slate-400 hover:bg-slate-700"
|
||||
}`}
|
||||
>
|
||||
{status.charAt(0).toUpperCase() + status.slice(1)}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Table */}
|
||||
<div className="bg-slate-800 rounded-lg overflow-hidden">
|
||||
<table className="w-full">
|
||||
<thead>
|
||||
<tr className="border-b border-slate-700">
|
||||
<th className="text-left p-4 text-slate-400 font-medium">Name</th>
|
||||
<th className="text-left p-4 text-slate-400 font-medium">Email</th>
|
||||
<th className="text-left p-4 text-slate-400 font-medium">Phone</th>
|
||||
<th className="text-left p-4 text-slate-400 font-medium">Status</th>
|
||||
<th className="text-left p-4 text-slate-400 font-medium">Source</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{filteredLeads.map(lead => (
|
||||
<tr key={lead.id} className="border-b border-slate-700/50 hover:bg-slate-700/30">
|
||||
<td className="p-4 text-white font-medium">{lead.name}</td>
|
||||
<td className="p-4 text-slate-400">{lead.email}</td>
|
||||
<td className="p-4 text-slate-400">{lead.phone}</td>
|
||||
<td className="p-4">
|
||||
<span className={`px-2 py-1 rounded text-xs font-medium ${statusColors[lead.status]}`}>
|
||||
{lead.status}
|
||||
</span>
|
||||
</td>
|
||||
<td className="p-4 text-slate-400">{lead.source}</td>
|
||||
<>
|
||||
<BackToMC />
|
||||
<div className="p-6">
|
||||
<div className="mb-6">
|
||||
<h1 className="text-3xl font-bold text-white mb-2">📋 Lead Manager</h1>
|
||||
<p className="text-slate-400">Manage your SiteMente leads</p>
|
||||
</div>
|
||||
<div className="flex gap-2 mb-6">
|
||||
{["all", "new", "contacted", "qualified"].map(s => (
|
||||
<button key={s} onClick={() => setFilter(s)} className={`px-4 py-2 rounded-lg text-sm ${filter === s ? "bg-brand-pink text-white" : "bg-slate-800 text-slate-400"}`}>
|
||||
{s.charAt(0).toUpperCase() + s.slice(1)}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="bg-slate-800 rounded-lg overflow-hidden">
|
||||
<table className="w-full">
|
||||
<thead>
|
||||
<tr className="border-b border-slate-700">
|
||||
<th className="text-left p-4 text-slate-400">Name</th>
|
||||
<th className="text-left p-4 text-slate-400">Email</th>
|
||||
<th className="text-left p-4 text-slate-400">Status</th>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody>
|
||||
{filteredLeads.map(lead => (
|
||||
<tr key={lead.id} className="border-b border-slate-700/50">
|
||||
<td className="p-4 text-white">{lead.name}</td>
|
||||
<td className="p-4 text-slate-400">{lead.email}</td>
|
||||
<td className="p-4"><span className={`px-2 py-1 rounded text-xs ${statusColors[lead.status]}`}>{lead.status}</span></td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className="text-slate-500 text-sm mt-4">
|
||||
Showing {filteredLeads.length} of {SAMPLE_LEADS.length} leads (database connection needed for full functionality)
|
||||
</p>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user