import React, { useEffect, useRef } from 'react'; import { Chart, CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend } from 'chart.js'; import { Bar } from 'react-chartjs-2'; import Navbar from '../components/Navbar'; Chart.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend); const Dashboard = () => { const userStats = { totalUsers: 100, totalAds: 50, totalRevenue: 5000 }; const chartData = { labels: ['Users', 'Revenue'], datasets: [ { label: 'Statistics', data: [userStats.totalUsers, userStats.totalRevenue], backgroundColor: ['rgba(75,192,192,0.6)', 'rgba(153,102,255,0.6)'], }, ], }; const chartRef = useRef(null); useEffect(() => { const chartInstance = chartRef.current.chartInstance; return () => { if (chartInstance) { chartInstance.destroy(); } }; }, []); return (

Dashboard

Total Users: {userStats.totalUsers}
Total Ads: {userStats.totalAds}
Total Revenue: {userStats.totalRevenue}
); }; export default Dashboard;