@@ -3,32 +3,32 @@ import { Box, Typography } from "@mui/material";
33
44import { Vote } from "@models" ;
55
6- const borderColorMap = {
6+ const borderColorMap : Record < string , string > = {
77 yes : "#C0E4BA" ,
88 no : "#EDACAC" ,
99 abstain : "#99ADDE" ,
10- notVoted : "#EAE9F0" ,
10+ notvoted : "#EAE9F0" ,
1111} ;
1212
13- const bgColorMap = {
13+ const bgColorMap : Record < string , string > = {
1414 yes : "#F0F9EE" ,
1515 no : "#FBEBEB" ,
1616 abstain : "#E6EBF7" ,
17- notVoted : "#F5F5F8" ,
17+ notvoted : "#F5F5F8" ,
1818} ;
1919
20- const voteLabelKey = {
20+ const voteLabelKey : Record < string , string > = {
2121 yes : "votes.yes" ,
2222 no : "votes.no" ,
2323 abstain : "votes.abstain" ,
24- notVoted : "votes.notVoted" ,
24+ notvoted : "votes.notVoted" ,
2525} ;
2626
27- const ccVoteLabelKey = {
27+ const ccVoteLabelKey : Record < string , string > = {
2828 yes : "votes.constitutional" ,
2929 no : "votes.unconstitutional" ,
3030 abstain : "votes.abstain" ,
31- notVoted : "" ,
31+ notvoted : "" ,
3232} ;
3333
3434type VoteExtended = Vote | "notVoted" ;
@@ -45,10 +45,11 @@ export const VotePill = ({
4545 isCC ?: boolean ;
4646} ) => {
4747 const { t } = useTranslation ( ) ;
48+ const voteKey = vote . toLocaleLowerCase ( ) ;
4849
49- const bgColor = bgColorMap [ vote ] ;
50- const borderColor = borderColorMap [ vote ] ;
51- const labelKey = isCC ? ccVoteLabelKey [ vote ] : voteLabelKey [ vote ] ;
50+ const bgColor = bgColorMap [ voteKey ] ;
51+ const borderColor = borderColorMap [ voteKey ] ;
52+ const labelKey = isCC ? ccVoteLabelKey [ voteKey ] : voteLabelKey [ voteKey ] ;
5253
5354 return (
5455 < Box
0 commit comments