lbry-desktop/ui/component/claimPreviewProgress/view.jsx
2022-04-01 15:37:26 -04:00

18 lines
378 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" style={{ width: `${(position / duration) * 100}%` }} />;
}