lbry-desktop/ui/component/claimPreviewProgress/view.jsx
2022-04-04 17:27:00 +08:00

22 lines
459 B
JavaScript

// @flow
import React from 'react';
type Props = {
uri: string,
position: ?number,
duration: ?number,
};
export default function ClaimPreviewProgress(props: Props) {
const { position, duration } = props;
if (!position || !duration) {
return null;
}
return (
<div className="claim-preview__progress-section">
<div className="claim-preview__progress-bar" style={{ width: `${(position / duration) * 100}%` }} />
</div>
);
}