// DashboardGrid.tsx import React, { useState } from "react"; import MultiRingCircularProgress from "./MultiRingCircularProgress"; import CampaignTracker from "./CampaignTracker"; import { ArrowLeft, Sparkles } from "lucide-react"; import HeaderPage from "./shared/HeaderPage"; import Google from "../assets/icons/google-original-logo.svg"; import Gemini2 from "../assets/icons/gemini2.svg"; import Perplexity from "../assets/icons/perplexity-dark-logo.svg"; import GPT from "../assets/icons/gpt.svg"; import Map from "../assets/icons/maps.svg"; import TotalBacklinks from "../assets/icons/iconheader/total.svg"; import ActiveKeywords from "../assets/icons/iconheader/active.svg"; import PortfolioPerformance from "../assets/icons/iconheader/portfolio.svg"; import InfoBadge from "../assets/icons/iconheader/info.svg"; import Amazon from "../assets/icons/amazon.svg"; interface TagContent { icon: string; text?: string; value?: string; extra?: string; } interface Tag { content: TagContent[]; color?: string; } interface HoverState { cardId: string | null; ringIndex: number | null; } const CARDS = [ { title: "CPA Hollywood", percent: 99, rings: [ { color: "#4c60e5", value: 99 }, // blue { color: "#4285f4", value: 50 }, // blue { color: "#34a853", value: 80 }, // green { color: "#fbbc05", value: 90 }, // yellow { color: "#ea4335", value: 40 } // red ], tags: [ { content: [ { icon: "Google", value: "14", extra: "+1" } ], color: "#4285F4" }, { content: [ { icon: "Map", value: "7", extra: "+2" } ], color: "#4285F4" }, { content: [ { icon: "Ai" }, { icon: "Perplexity" }, { icon: "GPT" } ] } ] }, { title: "CPA Los Angeles", percent: 24, rings: [ { color: "#4c60e5", value: 25 }, // blue { color: "#4285f4", value: 21 }, // blue { color: "#34a853", value: 40 }, // green { color: "#fbbc05", value: 30 }, // yellow { color: "#ea4335", value: 20 } // red ], tags: [ { content: [ { icon: "Google", value: "14", extra: "-2" } ], color: "#4285F4" }, { content: [ { icon: "Ai" }, { icon: "GPT" } ] } ] }, { title: "CPA Los Angeles4", percent: 45, rings: [ { color: "#4c60e5", value: 45 }, // blue { color: "#4285f4", value: 42 }, // blue { color: "#34a853", value: 32 }, // green { color: "#fbbc05", value: 28 }, // yellow { color: "#ea4335", value: 24 } // red ], tags: [ { content: [ { icon: "Google", value: "14", extra: "-2" } ], color: "#4285F4" }, { content: [ { icon: "Map", value: "5", extra: "+1" } ], color: "#4285F4" }, { content: [ { icon: "Ai" }, { icon: "Perplexity" } ] } ] }, { title: "Best CPA Los Angeles5", percent: 89, rings: [ { color: "#4c60e5", value: 89 }, // blue { color: "#4285f4", value: 80 }, // blue { color: "#34a853", value: 72 }, // green { color: "#fbbc05", value: 65 }, // yellow { color: "#ea4335", value: 57 } // red ], tags: [ { content: [ { icon: "Google", value: "14", extra: "+1" } ], color: "#4285F4" }, { content: [ { icon: "Map", value: "9", extra: "+3" } ], color: "#4285F4" }, { content: [ { icon: "Ai" }, { icon: "GPT" }, { icon: "Perplexity" } ] } ] }, { title: "CPA Hollywood 2", percent: 98, rings: [ { color: "#4c60e5", value: 98 }, // blue { color: "#4285f4", value: 98 }, // blue { color: "#34a853", value: 98 }, // green { color: "#fbbc05", value: 98 }, // yellow { color: "#ea4335", value: 100 } // red ], tags: [ { content: [ { icon: "Google", value: "14", extra: "+1" } ], color: "#4285F4" }, { content: [ { icon: "Map", value: "7", extra: "+2" } ], color: "#4285F4" }, { content: [ { icon: "Ai" }, { icon: "Perplexity" }, { icon: "GPT" } ] } ], badge: "Content Unlocked", actionLink: "View Published Content " }, { title: "Best CPA Los Angeles21", percent: 89, rings: [ { color: "#cccccc", value: 89 }, // gray { color: "#cccccc", value: 80 }, // gray { color: "#cccccc", value: 72 }, // gray { color: "#cccccc", value: 65 }, // gray { color: "#cccccc", value: 57 } // gray ], tags: [ { content: [ { icon: "Google", value: "14", extra: "+1" } ], color: "#cccccc" }, { content: [ { icon: "Map", value: "7", extra: "+2" } ], color: "#cccccc" }, { content: [ { icon: "Ai" }, { icon: "Perplexity" }, { icon: "GPT" } ] } ], faded: true, paused: true } ]; const competitors = [ { domain: "Cherrybekaertla.com", googleRank: 1, mapPins: 7, hasAi: true, hasCircle: true, hasDiamond: true, hasTree: true, hasLLM: true, tags: [ { content: [ { icon: "Google", value: "1" } ], color: "#4285F4" }, { content: [ { icon: "Map", value: "7", } ], color: "#4285F4" }, { content: [ { icon: "Ai" }, { icon: "Perplexity" }, { icon: "GPT" } ] } ] }, { domain: "Gerbercompany.com", googleRank: 1, mapPins: 7, hasAi: true, hasCircle: true, hasDiamond: true, hasTree: true, hasLLM: true, tags: [ { content: [ { icon: "Google", value: "1" } ], color: "#4285F4" }, { content: [ { icon: "Map", value: "7", } ], color: "#4285F4" }, { content: [ { icon: "Ai" }, { icon: "Perplexity" }, { icon: "GPT" } ] } ] }, { domain: "Mysite.com", googleRank: 1, mapPins: 7, hasAi: true, hasCircle: true, hasDiamond: true, hasTree: true, hasLLM: true, tags: [ { content: [ { icon: "Google", value: "1" } ], color: "#4285F4" }, { content: [ { icon: "Map", value: "7", } ], color: "#4285F4" }, { content: [ { icon: "Ai" }, { icon: "Perplexity" }, { icon: "GPT" } ] } ] }, ] export default function DashboardGrid() { const [selectedCampaigns, setSelectedCampaigns] = useState([]); const [tableView, setTableView] = useState(null); const [activeCard, setActiveCard] = useState(null); const [hoverState, setHoverState] = useState({ cardId: null, ringIndex: null }); const [isHovered, setIsHovered] = useState(false); const [showKeywordAnalysis, setShowKeywordAnalysis] = useState(null); const handleCardClick = (campaignName: string, paused: boolean) => { if (paused) return; setSelectedCampaigns([campaignName]); setActiveCard(campaignName); if (activeCard) { } }; const handleBackClick = (e: React.MouseEvent) => { e.stopPropagation(); // Prevent event bubbling to card click if (tableView) { setTableView(null); } else if (activeCard) { setSelectedCampaigns(prev => prev.filter(card => card !== activeCard)); setActiveCard(null); } }; const handleMenuClick = (campaignName: string) => { setTableView(campaignName); }; const handleRingHover = (cardId: string, ringIndex: number | null) => { setHoverState({ cardId, ringIndex }); }; const handleResumeClick = (campaignName: string) => { setShowKeywordAnalysis(campaignName); }; const TagComponent = ({ content, color = "#4285F4", faded = false }: Tag & { faded?: boolean }) => { const getIconContent = (item: TagContent) => { switch (item.icon) { case "Google": return ( <> Google {item.value && {item.value}} {item.extra && ( {item.extra} )} ); case "Map": return ( <> Map {item.value && {item.value}} {item.extra && ( {item.extra} )} ); case "Ai": return ( <> AI {item.value && {item.value}} {item.extra && ( {item.extra} )} ) case "GPT": return ( <> GPT {item.value && {item.value}} {item.extra && ( {item.extra} )} ) case "Perplexity": return ( <> Perplexity {item.value && {item.value}} {item.extra && ( {item.extra} )} ) default: return item.text || null; } }; return ( {content.map((item, index) => (
{getIconContent(item)}
))}
); }; const CardHeader = ({ title, value, valueChange, icon, tooltipText, extra }: { title: string, value: string, valueChange?: string, icon: string, tooltipText?: string, extra?: string }) => { return (
Active Keywords
{value} {extra && {extra}} {tooltipText &&
{ if (tooltipText) { setIsHovered(true) } }} onMouseLeave={() => { if (tooltipText) { setIsHovered(false) } }} > Info {isHovered && (
{/* Tooltip triangle */}
{tooltipText}
)}
}
{title}
{valueChange}
) } return ( <> {/* Main content area with new metric cards */}
{CARDS.map((card, idx) => (
handleCardClick(card.title, card.paused || false)} >
{/* Front of card */}
{ card.paused && showKeywordAnalysis === card.title ?
{/* New Keyword Badge */}
NEW High-Value Keyword Found
{/* Keyword Title */}

Tax Prep Attorney Los Angeles

{/* Competitors List */}
{competitors.map((competitor, index) => (
{competitor.domain}
{competitor.tags.map((tag, i) => ( ))}
))}
{/* Bottom CTA */}

Your competitors own this keyword.

Add it to capture visibility and sales.

:
{card.badge && (
{card.badge}
)} {idx === 3 && (
Top rankings
Top rankings
)} handleRingHover(card.title, index)} />
{card.title}
{/* Tags */}
{card.tags.map((tag, i) => ( ))}
{card.actionLink && (
{card.actionLink}
)} {card.paused && (
Campaign paused
) }
}
{/* Back of card */}
{/* Header */}

{card.title}

{/* */}
{/* Content with smooth transitions */}
handleMenuClick(card.title)} />
{/* Table View with smooth transitions */}
{[ { icon: Amazon, title: 'Questions to ask your CPA httpAmazon' }, { icon: Amazon, title: 'Questions to ask your CPA Published on Amazon' }, { icon: Amazon, title: 'Questions to ask your CPA Published on Amazon AWS' }, { icon: Amazon, title: 'Questions to ask your CPA httpAmazon' }, { icon: Amazon, title: 'Questions to ask your CPA Published on Amazon' }, { icon: Amazon, title: 'Questions to ask your CPA Published on Amazon AWS' }, { icon: Amazon, title: 'Questions to ask your CPA httpAmazon' }, { icon: Amazon, title: 'Questions to ask your CPA Published on Amazon' }, { icon: Amazon, title: 'Questions to ask your CPA Published on Amazon AWS' }, { icon: Amazon, title: 'Pinterest DR 97 DA 95 Traffic 3,989,220' }, { icon: Amazon, title: 'Questions to ask your CPA Substack DR 97 DA 95' } ].map((row, rIdx) => ( ))}
{row.title}
View All
))}
); } // This line to make just try to open one card // 106 // 112 // 118-121 // 149