'use client';
import { useState, useEffect } from 'react';
import Card from '@/components/ui/Card';
import Button from '@/components/ui/Button';
import {
BarChart3,
Eye,
Users,
Trophy,
TrendingUp,
Calendar,
DollarSign,
Target,
ArrowUpRight,
ArrowDownRight,
ExternalLink,
Loader2
} from 'lucide-react';
import Link from 'next/link';
interface SponsorshipMetrics {
impressions: number;
impressionsChange: number;
uniqueViewers: number;
viewersChange: number;
races: number;
drivers: number;
exposure: number;
exposureChange: number;
}
interface SponsoredLeague {
id: string;
name: string;
tier: 'main' | 'secondary';
drivers: number;
races: number;
impressions: number;
status: 'active' | 'upcoming' | 'completed';
}
interface SponsorDashboardData {
sponsorId: string;
sponsorName: string;
metrics: SponsorshipMetrics;
sponsoredLeagues: SponsoredLeague[];
investment: {
activeSponsorships: number;
totalInvestment: number;
costPerThousandViews: number;
};
}
// Fallback mock data for demo mode
const MOCK_DASHBOARD: SponsorDashboardData = {
sponsorId: 'demo-sponsor',
sponsorName: 'Demo Sponsor',
metrics: {
impressions: 124500,
impressionsChange: 12.5,
uniqueViewers: 8420,
viewersChange: 8.3,
races: 24,
drivers: 156,
exposure: 87.5,
exposureChange: 5.2,
},
sponsoredLeagues: [
{
id: 'league-1',
name: 'GT3 Pro Championship',
tier: 'main',
drivers: 32,
races: 12,
impressions: 45200,
status: 'active',
},
{
id: 'league-2',
name: 'Endurance Masters',
tier: 'main',
drivers: 48,
races: 6,
impressions: 38100,
status: 'active',
},
{
id: 'league-3',
name: 'Formula Sim Series',
tier: 'secondary',
drivers: 24,
races: 8,
impressions: 22800,
status: 'active',
},
{
id: 'league-4',
name: 'Touring Car Cup',
tier: 'secondary',
drivers: 28,
races: 10,
impressions: 18400,
status: 'upcoming',
},
],
investment: {
activeSponsorships: 4,
totalInvestment: 2400,
costPerThousandViews: 19.28,
},
};
function MetricCard({
title,
value,
change,
icon: Icon,
suffix = '',
}: {
title: string;
value: number | string;
change?: number;
icon: typeof Eye;
suffix?: string;
}) {
const isPositive = change && change > 0;
const isNegative = change && change < 0;
return (
Track your sponsorship performance and exposure
No active sponsorships yet.
Browse leagues to sponsorGT3 Pro Championship race completed
2 hours ago • 1,240 views
New driver joined Endurance Masters
5 hours ago
Touring Car Cup season starting soon
1 day ago
Alpha Note: Sponsor analytics data shown here is demonstration-only. Real analytics will be available when the sponsorship system is fully implemented.