week-5-module-2 / src /components /ProgressBar.tsx
iurbinah's picture
Upload 6 files
9be548f verified
raw
history blame contribute delete
419 Bytes
import React from 'react';
import { styles } from '../styles/appStyles';
const ProgressBar = ({ current, total }: { current: number; total: number }) => {
const progress = total > 1 ? (current / (total - 1)) * 100 : 0;
return (
<div style={styles.progressContainer}>
<div style={{ ...styles.progressBar, width: `${progress}%` }}></div>
</div>
);
};
export default ProgressBar;