'use client'; import Breadcrumbs from '@/components/layout/Breadcrumbs'; import PendingSponsorshipRequests from '@/components/sponsors/PendingSponsorshipRequests'; import Card from '@/components/ui/Card'; import { AlertTriangle, Building, ChevronRight, Handshake, Trophy, User, Users } from 'lucide-react'; import Link from 'next/link'; export interface EntitySection { entityType: 'driver' | 'team' | 'race' | 'season'; entityId: string; entityName: string; requests: any[]; } export interface SponsorshipRequestsTemplateProps { data: EntitySection[]; onAccept: (requestId: string) => Promise; onReject: (requestId: string, reason?: string) => Promise; } export function SponsorshipRequestsTemplate({ data, onAccept, onReject }: SponsorshipRequestsTemplateProps) { const totalRequests = data.reduce((sum, s) => sum + s.requests.length, 0); const getEntityIcon = (type: 'driver' | 'team' | 'race' | 'season') => { switch (type) { case 'driver': return User; case 'team': return Users; case 'race': return Trophy; case 'season': return Trophy; default: return Building; } }; const getEntityLink = (type: 'driver' | 'team' | 'race' | 'season', id: string) => { switch (type) { case 'driver': return `/drivers/${id}`; case 'team': return `/teams/${id}`; case 'race': return `/races/${id}`; case 'season': return `/leagues/${id}/sponsorships`; default: return '#'; } }; return (
{/* Header */}

Sponsorship Requests

Manage sponsorship requests for your profile, teams, and leagues

{totalRequests > 0 && (
{totalRequests} pending
)}
{data.length === 0 ? (

No Pending Requests

You don't have any pending sponsorship requests at the moment.

Sponsors can apply to sponsor your profile, teams, or leagues you manage.

) : (
{data.map((section) => { const Icon = getEntityIcon(section.entityType); const entityLink = getEntityLink(section.entityType, section.entityId); return ( {/* Section Header */}

{section.entityName}

{section.entityType}

View {section.entityType === 'season' ? 'Sponsorships' : section.entityType}
{/* Requests */}
); })}
)} {/* Info Card */}

How Sponsorships Work

Sponsors can apply to sponsor your driver profile, teams you manage, or leagues you administer. Review each request carefully - accepting will activate the sponsorship and the sponsor will be charged. You'll receive the payment minus a 10% platform fee.

); }