2024-09-03 22:00:51 +00:00
|
|
|
// Copyright 2024 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
export function ProgressBar({
|
|
|
|
fractionComplete,
|
2024-09-16 19:38:12 +00:00
|
|
|
isRTL,
|
2024-09-03 22:00:51 +00:00
|
|
|
}: {
|
|
|
|
fractionComplete: number;
|
2024-09-16 19:38:12 +00:00
|
|
|
isRTL: boolean;
|
2024-09-03 22:00:51 +00:00
|
|
|
}): JSX.Element {
|
|
|
|
return (
|
|
|
|
<div className="ProgressBar">
|
|
|
|
<div
|
|
|
|
className="ProgressBar__fill"
|
|
|
|
style={{
|
2024-09-16 19:38:12 +00:00
|
|
|
transform: `translateX(${(isRTL ? -1 : 1) * (fractionComplete - 1) * 100}%)`,
|
2024-09-03 22:00:51 +00:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|