import { useMemo } from "react" ; import CharacterString from "../CharacterString" ; import * as Actions from "../../selectors" ; import { useTypedSelector } from "../../hooks" ; function rightPad ( str , len , fillChar ) { while ( str . length < len ) { str += fillChar ; } return str ; } const RunningTimeDisplay = ( ) => { const runningTimeMessage = useTypedSelector ( Actions . getRunningTimeMessage ) ; const text = useMemo ( ( ) => rightPad ( runningTimeMessage , 18 , " " ) , [ runningTimeMessage ] ) ; return ( < div className = "playlist-running-time-display draggable" > { } < div > < CharacterString > { text } < /CharacterString> < /div> < /div>); } ; export default RunningTimeDisplay ;