import { ExternalLink, Sparkles } from 'lucide-react';
import { sanitizeUrl } from '@/lib/sanitizeUrl';
import { cn } from '@/lib/utils';
import { EVENT_SPONSOR_TIERS, type EventSponsor } from '@/lib/types';
function SponsorLogo({ sponsor, large }: { sponsor: EventSponsor; large?: boolean }) {
const safeUrl = sponsor.url ? sanitizeUrl(sponsor.url) : null;
const safeLogo = sponsor.logo ? sanitizeUrl(sponsor.logo) : null;
const inner = (
{safeLogo ? (

) : (
{sponsor.name}
)}
{safeLogo && (
{sponsor.name}
{safeUrl && (
)}
)}
);
if (safeUrl) {
return (
{inner}
);
}
return inner;
}
/**
* Sponsor strip for an event. Title sponsor gets a hero row; the rest render in
* a responsive grid. Sponsors give events a "this is a real production" feel and
* open a monetization surface for hosts + brands.
*/
export function EventSponsors({
sponsors,
className,
}: {
sponsors: EventSponsor[];
className?: string;
}) {
if (!sponsors || sponsors.length === 0) return null;
const title = sponsors.filter((s) => s.tier === 'title');
const rest = sponsors.filter((s) => s.tier !== 'title');
return (
Presented by
{title.length > 0 && (
{title.map((s, i) => (
{EVENT_SPONSOR_TIERS.title.label}
))}
)}
{rest.length > 0 && (
{rest.map((s, i) => (
))}
)}
);
}