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

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