import React, { useEffect, useRef } from 'react' import PropTypes from 'prop-types' import { CRow, CCol, CDropdown, CDropdownMenu, CDropdownItem, CDropdownToggle, CWidgetStatsA, } from '@coreui/react' import { getStyle } from '@coreui/utils' import { CChartBar, CChartLine } from '@coreui/react-chartjs' import CIcon from '@coreui/icons-react' import { cilArrowBottom, cilArrowTop, cilOptions } from '@coreui/icons' const WidgetsDropdown = (props) => { const widgetChartRef1 = useRef(null) const widgetChartRef2 = useRef(null) useEffect(() => { document.documentElement.addEventListener('ColorSchemeChange', () => { if (widgetChartRef1.current) { setTimeout(() => { widgetChartRef1.current.data.datasets[0].pointBackgroundColor = getStyle('--cui-primary') widgetChartRef1.current.update() }) } if (widgetChartRef2.current) { setTimeout(() => { widgetChartRef2.current.data.datasets[0].pointBackgroundColor = getStyle('--cui-info') widgetChartRef2.current.update() }) } }) }, [widgetChartRef1, widgetChartRef2]) return ( 26K{' '} (-12.4% ) } title="Users" action={ Action Another action Something else here... Disabled action } chart={ } /> $6.200{' '} (40.9% ) } title="Income" action={ Action Another action Something else here... Disabled action } chart={ } /> 2.49%{' '} (84.7% ) } title="Conversion Rate" action={ Action Another action Something else here... Disabled action } chart={ } /> 44K{' '} (-23.6% ) } title="Sessions" action={ Action Another action Something else here... Disabled action } chart={ } /> ) } WidgetsDropdown.propTypes = { className: PropTypes.string, withCharts: PropTypes.bool, } export default WidgetsDropdown