const html = require('choo/html'); const percent = require('../../utils').percent; const radius = 73; const oRadius = radius + 10; const oDiameter = oRadius * 2; const circumference = 2 * Math.PI * radius; module.exports = function(progressRatio, indefinite = false) { // HACK - never indefinite for MS Edge if (/edge/i.test(navigator.userAgent)) { indefinite = false; } const p = indefinite ? 0.2 : progressRatio; const dashOffset = (1 - p) * circumference; const progressPercent = html` ${percent(progressRatio)} `; return html`
${indefinite ? '' : progressPercent}
`; };