aboutsummaryrefslogtreecommitdiff
path: root/src/utils/get-progress-bar.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/get-progress-bar.ts')
-rw-r--r--src/utils/get-progress-bar.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/utils/get-progress-bar.ts b/src/utils/get-progress-bar.ts
new file mode 100644
index 0000000..7db3dd0
--- /dev/null
+++ b/src/utils/get-progress-bar.ts
@@ -0,0 +1,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;
+};