aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/loaders/progress-bar.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-09-29 15:49:14 +0200
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:14:40 +0100
commit9128c224c65f8f2a172b22a443ccb4573c7acd90 (patch)
treebc435554174a5ed4c3f8808190cb94016f8d28f0 /src/components/atoms/loaders/progress-bar.tsx
parent81b1e0e05919eb368a66aef47adcf7738af76f29 (diff)
refactor(components): rewrite ProgressBar component
* Avoid browser vendors by adding an extra div * Add a loading state * Add an option to center the progress bar (no longer the default) * Remove min since it is always 0
Diffstat (limited to 'src/components/atoms/loaders/progress-bar.tsx')
-rw-r--r--src/components/atoms/loaders/progress-bar.tsx57
1 files changed, 0 insertions, 57 deletions
diff --git a/src/components/atoms/loaders/progress-bar.tsx b/src/components/atoms/loaders/progress-bar.tsx
deleted file mode 100644
index 195bb21..0000000
--- a/src/components/atoms/loaders/progress-bar.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import { FC } from 'react';
-import styles from './progress-bar.module.scss';
-
-export type ProgressBarProps = {
- /**
- * Current value.
- */
- current: number;
- /**
- * The progress bar id.
- */
- id: string;
- /**
- * The progress bar label.
- */
- label: string;
- /**
- * Minimal value.
- */
- min: number;
- /**
- * Maximal value.
- */
- max: number;
-};
-
-/**
- * ProgressBar component
- *
- * Render a progress bar.
- */
-export const ProgressBar: FC<ProgressBarProps> = ({
- current,
- id,
- label,
- min,
- max,
-}) => {
- return (
- <div className={styles.progress}>
- <label htmlFor={id} className={styles.progress__info}>
- {label}
- </label>
- <progress
- aria-valuemin={min}
- aria-valuemax={max}
- aria-valuenow={current}
- className={styles.progress__bar}
- id={id}
- max={max}
- value={current}
- >
- {current}/{max}
- </progress>
- </div>
- );
-};