{pollEvent.content}
{#if isExpired}
Poll ended
{:else if submittingVote}
Submitting vote...
{:else if hasVoted}
You have already voted
{/if}
{#each options as option (option.id)} {@const percentage = getPercentage(option.id)} {@const count = voteCounts.get(option.id) || 0} {@const isSelected = userVote.includes(option.id)}
!isExpired && !submittingVote && !hasVoted && submitVote(option.id)} disabled={isExpired || submittingVote || hasVoted} onkeydown={(e) => { if (!isExpired && !submittingVote && !hasVoted && (e.key === 'Enter' || e.key === ' ')) { e.preventDefault(); submitVote(option.id); } }} >
{option.label}
{percentage.toFixed(1)}%
{#if count > 0}
({count})
{/if}
{/each}