Files
zkldi_Tachi/client/src/components/util/ProgressBar.tsx
T
2021-09-13 10:39:29 +01:00

33 lines
580 B
TypeScript

import React, { CSSProperties } from "react";
import { integer } from "tachi-common";
export default function CustomProgressBar({
animated,
striped,
style,
max = 100,
now = 0,
}: {
animated?: boolean;
striped?: boolean;
style?: CSSProperties;
max?: integer;
now?: integer;
}) {
return (
<div className="progress">
<div
className={`progress-bar${animated ? " progress-bar-animated" : ""}${
striped ? " progress-bar-striped" : ""
}`}
style={Object.assign(
{
width: `${(now / max) * 100}%`,
},
style
)}
/>
</div>
);
}