const calcWidth = require('./calc-text-width.js').Arial12 module.exports = function ({subject, status, color = '4C1'}) { // const charWidth = 7.3 const calcFactor = 0.4 const sbTextWidth = calcWidth(subject) + subject.length * calcFactor // const sbTextWidth = subject.length * charWidth const sbRectWidth = sbTextWidth + 10 const sbTextCenter = sbRectWidth / 2 const stTextWidth = calcWidth(status) + status.length * calcFactor // const stTextWidth = status.length * charWidth const stRectWidth = stTextWidth + 12 const stTextCenter = sbRectWidth + stRectWidth / 2 - 1 const width = sbRectWidth + stRectWidth return ` ${subject} ${subject} ${status} ${status} ` }