- Notifications
You must be signed in to change notification settings - Fork 440
/
Copy pathProgressBar.tsx
28 lines (26 loc) · 720 Bytes
/
ProgressBar.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
importReactfrom'@theia/core/shared/react';
exporttypeProgressBarProps={
percent?: number;
showPercentage?: boolean;
};
exportdefaultfunctionProgressBar({
percent =0,
showPercentage =false,
}: ProgressBarProps): React.ReactElement{
constroundedPercent=Math.round(percent);
return(
<divclassName="progress-bar">
<divclassName="progress-bar--outer">
<div
className="progress-bar--inner"
style={{width: `${roundedPercent}%`}}
/>
</div>
{showPercentage&&(
<divclassName="progress-bar--percentage">
<divclassName="progress-bar--percentage-text">{roundedPercent}%</div>
</div>
)}
</div>
);
}