import React from 'react' import { TruckSvg } from '../../assets/svg/truckSvg' interface ProgressProps { done: number tagValue?: number | string } /** * Progress component. * * Renders a progress bar that animates the width based on the `done` prop. * * @param props - The component props. * @param props.done - The percentage of progress. */ export const Progress = ({ done, tagValue }: ProgressProps) => { const [style, setStyle] = React.useState({}) React.useEffect(() => { const newStyle: React.CSSProperties = { opacity: 1, width: `${done}%`, }; setStyle(newStyle); }, [done]); return (
{tagValue && ( {tagValue} )}
) }