11import { tv } from "tailwind-variants" ;
22
33import { sortOptions } from "@/features/retrofunding/utils/metricsBallot" ;
4- import { Select } from "@/primitives" ;
4+ import { ProgressBar , Select } from "@/primitives" ;
55
66const variants = tv ( {
77 slots : {
88 container : "flex items-center justify-between text-sm text-grey-500" ,
99 titleContainer : "flex w-[520px] flex-col justify-start gap-2" ,
1010 title : "text-lg font-medium text-black" ,
1111 description : "text-sm font-normal text-grey-900" ,
12+ progressBarContainer : "flex items-center gap-2" ,
13+ progressBarLabel : "font-ui-sans text-sm font-normal text-black" ,
1214 select :
1315 "w-fit shrink-0 px-3 py-2 font-medium ring-0 hover:ring-0 focus:outline-none focus:ring-0 active:ring-0" ,
1416 } ,
@@ -18,14 +20,19 @@ const BALLOT_INFO =
1820 "Distribute your votes across the metrics on your ballot as percentages, ensuring they add up to 100% before submission. You can hide metrics if needed and revisit this step anytime before finalizing your ballot." ;
1921
2022interface BallotHeaderProps {
23+ sumOfAllocations : number ;
2124 sortOrder : string ;
2225 setSortOrder : ( value : string ) => void ;
2326}
2427
25- export const BallotHeader = ( { sortOrder, setSortOrder } : BallotHeaderProps ) => (
28+ export const BallotHeader = ( { sortOrder, setSortOrder, sumOfAllocations } : BallotHeaderProps ) => (
2629 < div className = { variants ( ) . container ( ) } >
2730 < div className = { variants ( ) . titleContainer ( ) } >
28- < span className = { variants ( ) . title ( ) } > Your Ballot</ span >
31+ < div className = { variants ( ) . progressBarContainer ( ) } >
32+ < span className = { variants ( ) . title ( ) } > Your Ballot</ span >
33+ < ProgressBar variant = "green-sm" value = { sumOfAllocations } max = { 100 } />
34+ < span className = { variants ( ) . progressBarLabel ( ) } > { sumOfAllocations } % allocated</ span >
35+ </ div >
2936 < span className = { variants ( ) . description ( ) } > { BALLOT_INFO } </ span >
3037 </ div >
3138 < Select
0 commit comments