aboutsummaryrefslogtreecommitdiff
path: root/src/utils/get-progress-bar.ts
blob: 7db3dd0b27245409182cb37d03e00d192ae0d5ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
export default (width: number, progress: number): string => {
  const dotPosition = Math.floor(width * progress);

  let res = '';

  for (let i = 0; i < width; i++) {
    if (i === dotPosition) {
      res += '🔘';
    } else {
      res += '▬';
    }
  }

  return res;
};