import React, { useRef, useEffect } from 'react'
import {connect} from 'react-redux'
import { Bar } from 'react-chartjs-2'
import {data, options} from '../chart-data/default-chart.data'
import {  
    getGetIsPatient
} from  '../../../../redux/user/selectors'
import "./bar-chart-panel.styles.scss"

const BarChartPanelComponent = ({title, chartData=data, chartOptions=options}) => {
    const canvasRef= useRef(null)

    useEffect(() => {

    }, [])

    return (  
        <div className="panel panel-white">
            <div className="panel-heading">
                <h3 className="panel-title">{title}</h3>
            </div>
            <div className="panel-body">
                <div>
                    <Bar data={chartData} options={chartOptions} />                    
                </div>
            </div>
        </div>
    )
}

const mapStateToProps = (state) => ({
})

const mapDispatchToProps = dispatch => ({
})

export default connect(mapStateToProps, mapDispatchToProps)(BarChartPanelComponent)
