"use client"; import type { DetectedTracker } from "@/app/actions"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { BarChart3, MousePointerClick, Target, Users, Database, Code, Eye, } from "lucide-react"; interface TrackingDisplayProps { trackers: DetectedTracker[]; } const trackerInfo: { [key: string]: { icon: React.ElementType; description: string }; } = { "Google Analytics": { icon: BarChart3, description: "Web analytics service that tracks and reports website traffic.", }, "Google Tag Manager": { icon: Code, description: "Tag management system to easily deploy and manage marketing tags.", }, "Facebook Pixel": { icon: Target, description: "Analytics tool to measure the effectiveness of advertising by understanding actions people take on a website.", }, Hotjar: { icon: MousePointerClick, description: "Behavior analytics tool that reveals the online behavior and voice of users.", }, HubSpot: { icon: Users, description: "Inbound marketing, sales, and service software.", }, Segment: { icon: Database, description: "Customer data platform that collects, cleans, and controls customer data.", }, Mixpanel: { icon: BarChart3, description: "Product analytics tool for tracking user interactions with web and mobile applications.", }, "Vercel Analytics": { icon: BarChart3, description: "Privacy-friendly analytics for websites deployed on Vercel.", }, Plausible: { icon: BarChart3, description: "A simple, lightweight and privacy-friendly web analytics tool.", }, "Microsoft Clarity": { icon: Eye, description: "A free user behavior analytics tool that helps you understand how users are interacting with your website.", }, Default: { icon: Code, description: "A detected tracking or analytics tool.", }, }; export function TrackingDisplay({ trackers }: TrackingDisplayProps) { return ( Tracking Analysis Tracking and analytics tools detected on the page. {trackers && trackers.length > 0 ? (
{trackers.map((tracker, index) => { const info = trackerInfo[tracker.name] || trackerInfo["Default"]; const Icon = info.icon; return (

{tracker.name}

{info.description}

); })}
) : (

No specific tracking tools detected.

)}
); }