lbry-desktop/ui/component/claimPreviewProgress/view.jsx

23 lines
459 B
React
Raw Normal View History

2022-04-01 16:56:18 +02:00
// @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;
}
2022-04-04 11:27:00 +02:00
return (
<div className="claim-preview__progress-section">
<div className="claim-preview__progress-bar" style={{ width: `${(position / duration) * 100}%` }} />
</div>
);
2022-04-01 16:56:18 +02:00
}