| 1 |
export const ProgressBar = ({ currentPageIndex, totalPages }) => { |
| 2 |
const currentProgress = Math.round( |
| 3 |
((currentPageIndex + 1) / totalPages) * 100, |
| 4 |
) |
| 5 |
const currentPageText = `(${currentPageIndex}/${totalPages - 1})` |
| 6 |
|
| 7 |
return ( |
| 8 |
<div className="flex-1 hidden md:flex justify-center items-center"> |
| 9 |
<div |
| 10 |
role="progressbar" |
| 11 |
aria-valuenow={currentProgress} |
| 12 |
aria-valuemin="0" |
| 13 |
aria-valuetext={currentPageText} |
| 14 |
aria-valuemax="100" |
| 15 |
className="w-32 bg-gray-200 h-2 rounded-full"> |
| 16 |
<div |
| 17 |
className="rounded-full bg-partner-primary-bg h-2" |
| 18 |
style={{ |
| 19 |
width: `${currentProgress}%`, |
| 20 |
}}></div> |
| 21 |
</div> |
| 22 |
<div className="pl-2 flex justify-center">{currentPageText}</div> |
| 23 |
</div> |
| 24 |
) |
| 25 |
} |
| 26 |
|