castVote(selected!)}> {#each options.toSorted((a, b) => a.sort_order - b.sort_order) as choice} {@const active = selected == choice.id || (typeof selected !== 'number' && selected?.includes(choice.id))} {@const percentage = Math.floor( (choice.num_votes / totalVotes || 0) * 100, )} {@const multi = post.poll.mode != 'single'}
  • {#if chosen}
    {/if}
  • {/each}
    {$t('post.poll.votes', { votes: totalVotes })} {#snippet action()} {#if (selected && canVote) || loading} {:else if post.poll.end_poll} {$t('post.poll.results.ends', { time: formatRelativeDate(publishedToDate(post.poll.end_poll), {}), })} {/if} {/snippet}