--- /** * VotingMethodCard - Visual explainer card for a voting method * Shows icon, name, description, and interactive example */ interface Props { method: 'approval' | 'ranked_choice' | 'schulze' | 'star' | 'quadratic'; compact?: boolean; selected?: boolean; interactive?: boolean; } const { method, compact = false, selected = false, interactive = false } = Astro.props; const methodData = { approval: { name: 'Approval Voting', icon: 'icon-approval', color: '#22c55e', shortDesc: 'Select all options you approve', fullDesc: 'Vote for as many options as you like. The option with the most approvals wins. Simple and reduces strategic voting.', complexity: 1, pros: ['Simple to understand', 'No spoiler effect', 'Encourages honest voting'], cons: ['No preference intensity', 'May produce ties'], }, ranked_choice: { name: 'Ranked Choice', icon: 'icon-ranked-choice', color: '#3b82f6', shortDesc: 'Rank options in order of preference', fullDesc: 'Rank candidates from first to last choice. If no majority, lowest candidate eliminated and votes redistributed until majority.', complexity: 2, pros: ['Eliminates spoiler effect', 'Majority winner', 'Expresses preferences'], cons: ['More complex counting', 'Non-monotonic edge cases'], }, schulze: { name: 'Schulze Method', icon: 'icon-schulze', color: '#8b5cf6', shortDesc: 'Pairwise comparison tournament', fullDesc: 'Condorcet-consistent method using strongest paths. Compares every pair of options and finds the winner who beats all others.', complexity: 3, pros: ['Condorcet winner guaranteed', 'Handles cycles', 'Clone-proof'], cons: ['Complex to explain', 'Requires all rankings'], }, star: { name: 'STAR Voting', icon: 'icon-star', color: '#f59e0b', shortDesc: 'Score options 0-5, top two face runoff', fullDesc: 'Score Then Automatic Runoff: Rate each option 0-5 stars. Top two scoring options go to automatic runoff based on preferences.', complexity: 2, pros: ['Express intensity', 'Automatic runoff', 'Reduces strategy'], cons: ['Two-phase complexity', 'Score interpretation varies'], }, quadratic: { name: 'Quadratic Voting', icon: 'icon-quadratic', color: '#ec4899', shortDesc: 'Spend credits where cost = votes²', fullDesc: 'Allocate credits to options. Cost grows quadratically: 1 vote = 1 credit, 2 votes = 4 credits, 3 = 9. Express intensity of preference.', complexity: 3, pros: ['Intensity expression', 'Prevents vote buying', 'Fair allocation'], cons: ['Budget strategy', 'Math complexity'], }, }; const data = methodData[method]; const complexityBars = Array(3).fill(0).map((_, i) => i < data.complexity); ---
{data.fullDesc}
{data.shortDesc}
)}