import React from 'react'; import { Users, MessageSquare, FileText, Calendar, CheckCircle, XCircle } from 'lucide-react'; /** * DecisionCard Component * Shows individual decision with speakers, rationale, and details */ export default function DecisionCard({ decision, onClick }) { const { decision_summary, outcome, primary_rationale, supporters = [], opponents = [], vote_result, meeting_date, tradeoffs_discussed = [], evidence_cited = [], policy_domain = 'general', community_gap, ntee_code } = decision; const domainColors = { health: '#1D9E75', education: '#185FA5', facilities: '#BA7517', budget: '#D85A30', personnel: '#6B4C9A', safety: '#E24B4A', community: '#2C7A7B', policy: '#744210', general: '#888' }; const isApproved = outcome?.toLowerCase().includes('approved') || outcome?.toLowerCase().includes('passed'); return (
{ e.currentTarget.style.boxShadow = '0 2px 8px rgba(0,0,0,0.1)'; e.currentTarget.style.borderLeftWidth = '6px'; }} onMouseLeave={(e) => { e.currentTarget.style.boxShadow = 'none'; e.currentTarget.style.borderLeftWidth = '4px'; }} > {/* Header */}
{decision_summary}
{meeting_date ? new Date(meeting_date).toLocaleDateString() : 'Date unknown'} {vote_result && ( Vote: {vote_result} )}
{isApproved ? : } {outcome || 'Unknown'}
{/* Rationale */} {primary_rationale && (
Primary Rationale
"{primary_rationale}"
)} {/* Speakers */} {(supporters.length > 0 || opponents.length > 0) && (
{supporters.length > 0 && (
Supporters ({supporters.length})
{supporters.slice(0, 2).map((supporter, i) => (
• {typeof supporter === 'string' ? supporter : supporter.name || 'Unknown'} {supporter.role && ({supporter.role})}
))} {supporters.length > 2 && (
+{supporters.length - 2} more
)}
)} {opponents.length > 0 && (
Opponents ({opponents.length})
{opponents.slice(0, 2).map((opponent, i) => (
• {typeof opponent === 'string' ? opponent : opponent.name || 'Unknown'} {opponent.role && ({opponent.role})}
))} {opponents.length > 2 && (
+{opponents.length - 2} more
)}
)}
)} {/* Tradeoffs & Evidence */}
{tradeoffs_discussed.length > 0 && ( {tradeoffs_discussed.length} tradeoff{tradeoffs_discussed.length > 1 ? 's' : ''} )} {evidence_cited.length > 0 && ( {evidence_cited.length} source{evidence_cited.length > 1 ? 's' : ''} )} {community_gap?.nonprofit_filling_gap && ( 🤝 Community filling gap )} {ntee_code && ( NTEE: {ntee_code} )}
); }