"use client"; import type { TrackingTool } from "@/app/actions"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { CopyButton } from "./copy-button"; import { BarChart, Tag, Facebook, Activity, Wind } from "lucide-react"; interface TrackingDisplayProps { tools: TrackingTool[]; } const toolInfo: { [key: string]: { icon: React.ElementType; description: string }; } = { "Google Tag Manager": { icon: Tag, description: "A tag management system to deploy and update marketing tags.", }, "Google Analytics (GA4)": { icon: BarChart, description: "The latest version of Google's web analytics service.", }, "Google Analytics (Universal)": { icon: BarChart, description: "The previous generation of Google Analytics.", }, "Facebook Pixel": { icon: Facebook, description: "An analytics tool to measure the effectiveness of advertising.", }, Hotjar: { icon: Wind, description: "A tool for behavior analytics and user feedback.", }, HubSpot: { icon: Activity, description: "An inbound marketing, sales, and service software.", }, Default: { icon: Activity, description: "A detected tracking or analytics tool.", }, }; export function TrackingDisplay({ tools }: TrackingDisplayProps) { return ( Tracking Analysis External analytics and marketing tools detected on the page. {tools && tools.length > 0 ? (
{tools.map((tool, index) => { const info = toolInfo[tool.name] || toolInfo["Default"]; const Icon = info.icon; return (

{tool.name}

{info.description}

{tool.id && (
{tool.id}
)}
); })}
) : (

No external tracking tools detected.

)}
); }