import { Sparkles, Check } from 'lucide-react'; import { Switch } from '@/components/ui/switch'; import { PlatformFeePayment } from '@/components/PlatformFeePayment'; import { usePlatformFee, type FeeType } from '@/hooks/usePlatformFee'; import { cn } from '@/lib/utils'; interface FeaturedUpgradeProps { /** Which platform fee this upgrade drives. */ type: Extract; /** Noun shown to the user, e.g. "event" or "tour". */ noun: string; /** Where featured items appear, e.g. "events page" or "tours". */ placement: string; enabled: boolean; onEnabledChange: (enabled: boolean) => void; className?: string; } /** * Opt-in "Feature this " upgrade. * * Every listing posts for free. Toggling this on reveals the Lightning fee and, * once paid (or for platform owners), the item is published with a `featured` * tag that gives it a badge + top placement. */ export function FeaturedUpgrade({ type, noun, placement, enabled, onEnabledChange, className, }: FeaturedUpgradeProps) { const { isActive, isPlatformOwner, daysRemaining } = usePlatformFee(type); return (

Feature this {noun} · optional

Free to post. Featured {noun}s get a badge and sit {' '}at the top of {placement}.

{isActive ? ( Active ) : ( )}
{isActive && (

{isPlatformOwner ? 'Platform owner — featured is always on.' : `Featured active · ${daysRemaining} day${daysRemaining !== 1 ? 's' : ''} remaining.`}

)}
{enabled && !isActive && (
{ /* hook auto-updates isActive */ }} context={`Your ${noun} stays listed for free either way — featured just adds the badge & boost.`} />
)}
); } /** Convenience wrapper for events. */ export function FeaturedEventUpgrade(props: { enabled: boolean; onEnabledChange: (enabled: boolean) => void; className?: string; }) { return ( ); }