+
+ // Using color and running we build the text, border, and background style properties
+ return {
+ // Set background color when not running, otherwise use white
+ backgroundColor: running ? theme.palette.common.white : color,
+ // Set text color to status color when running, else use white text for solid button
+ color: running ? color : theme.palette.common.white,
+ // Set border color when running, else omit the style entirely
+ ...(running ? {border: `2px solid ${color}`} : {}),
+ };