import { Component } from 'react'
import { CountdownCircleTimer } from 'react-countdown-circle-timer'

export class Timer extends Component {
    render() {
        console.log("alo")
        console.log(this.props.duration)
        console.log(this.props.initialRemainingTime)
        return (
            <CountdownCircleTimer
                isPlaying
                duration={this.props.duration}
                initialRemainingTime={this.props.initialRemainingTime}
                colors={['#004777', '#F7B801', '#A30000', '#A30000']}
                colorsTime={[7, 5, 2, 0]}
            >
                {({ remainingTime }) => {
                    const minutes = Math.floor(remainingTime / 60)
                    const seconds = remainingTime % 60

                    return `${minutes}:${seconds}`
                }}
            </CountdownCircleTimer>
        )
    }
}
