import React, { useMemo, useState } from “react”;
import { motion } from “framer-motion”;
import { Card, CardContent } from “@/components/ui/card”;
import { Button } from “@/components/ui/button”;
import { Badge } from “@/components/ui/badge”;
import { Tabs, TabsContent, TabsList, TabsTrigger } from “@/components/ui/tabs”;
import { Input } from “@/components/ui/input”;
import { AreaChart, Area, XAxis, YAxis, Tooltip, ResponsiveContainer, BarChart, Bar } from “recharts”;
import { ArrowUpRight, Bell, Bot, Crown, Eye, Gauge, MapPin, Megaphone, MousePointerClick, Search, Sparkles, Star, TrendingUp, Users, Wand2 } from “lucide-react”;
const views = [
{ day: “Mon”, views: 84, leads: 4 },
{ day: “Tue”, views: 112, leads: 5 },
{ day: “Wed”, views: 96, leads: 3 },
{ day: “Thu”, views: 154, leads: 8 },
{ day: “Fri”, views: 188, leads: 11 },
{ day: “Sat”, views: 221, leads: 13 },
{ day: “Sun”, views: 176, leads: 9 }
];
const sources = [
{ name: “Wales.gb.1 AI Search”, value: 38 },
{ name: “Local Directory”, value: 29 },
{ name: “Events Page”, value: 18 },
{ name: “Google / Social”, value: 15 }
];
const upsells = [
{ title: “Upgrade to Featured Listing”, reason: “Your listing is getting strong views but appears below 6 competitors.”, impact: “+35% estimated visibility”, cta: “Upgrade for £20/mo”, priority: “High” },
{ title: “Launch Local Ad Campaign”, reason: “Searches for your category increased 42% this week in Cardiff.”, impact: “Estimated 18-30 new leads”, cta: “Start campaign”, priority: “High” },
{ title: “AI Listing Rewrite”, reason: “Your profile has a lower conversion rate than similar businesses.”, impact: “+12% estimated conversion”, cta: “Improve with AI”, priority: “Medium” },
{ title: “DVANA Growth Review”, reason: “You have traffic, but enquiry conversion is below benchmark.”, impact: “Book strategy call”, cta: “Book review”, priority: “Medium” }
];
export default function WalesCommunitySMEDashboard() {
const [businessName, setBusinessName] = useState(“Cardiff Plumbing Services”);
const totalViews = useMemo(() => views.reduce((a, b) => a + b.views, 0), []);
const totalLeads = useMemo(() => views.reduce((a, b) => a + b.leads, 0), []);
const conversion = ((totalLeads / totalViews) * 100).toFixed(1);
return (
{businessName}
Track discovery, leads, AI search visibility and growth opportunities from one dashboard.
[Eye, “Views this week”, totalViews.toLocaleString(), “+24%”],
[MousePointerClick, “Leads”, totalLeads.toString(), “+18%”],
[Gauge, “Conversion”, `${conversion}%`, “Below benchmark”],
[Search, “AI searches”, “438”, “+42%”]
].map(([Icon, label, value, note]) => (
))}
Traffic & Lead Performance
Discovery Sources
{upsells.map((u) => (
{u.title}
{u.reason}
))}
{[
[Star, “Listing Score”, “78/100”, “Add 3 more photos and service areas.”],
[MapPin, “Local Coverage”, “Cardiff + 8km”, “Expand radius to reach Newport searches.”],
[Crown, “Competitor Position”, “#7”, “Featured listing could move you into top 3.”]
].map(([Icon, title, value, text]) => (
{text}
))}
AI Growth Recommendation
Your category is trending this week. Run a 7-day sponsored campaign targeting “emergency plumber Cardiff” and “local plumber near me”. Suggested budget: £75–£150.
No active paid campaign
Start with a local featured campaign to turn current search demand into enquiries.
Business Profile
Demo control: rename the business to preview white-label dashboards.
setBusinessName(e.target.value)} />
);
}
