Problem
Build a poll widget where a user votes for one option and sees the live result distribution.
Requirements
- Render a question and multiple options.
- Selecting an option records the vote and shows each option's percentage and a bar.
- Prevent double voting (lock after a vote) or allow changing the vote (your choice — state it).
- (Bonus) Show total votes; animate the result bars.
Hints / Approach
- State:
options: [{ id, label, votes }]andvotedOptionId. - Percentage =
option.votes / totalVotes * 100; render a bar withwidth: ${pct}%. - For changing votes, decrement the previous option and increment the new one.