import React, { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import { api } from '../services/api'; import { Server, MessageSquare, Users, Activity } from 'lucide-react'; function Dashboard() { const [stats, setStats] = useState({ totalServers: 0, totalMessages: 0, totalUsers: 0, botStatus: 'online' }); const [recentActivity, setRecentActivity] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { loadDashboardData(); }, []); const loadDashboardData = async () => { try { // Mock data - w prawdziwej aplikacji pobierz z API setStats({ totalServers: 5, totalMessages: 23, totalUsers: 1, botStatus: 'online' }); setRecentActivity([ { id: 1, type: 'message_updated', server: 'Test Server', timestamp: new Date(), description: 'Zaktualizowano wiadomość powitalną' }, { id: 2, type: 'channel_configured', server: 'Test Server', timestamp: new Date(Date.now() - 3600000), description: 'Skonfigurowano kanał #witamy' } ]); } catch (error) { console.error('Error loading dashboard data:', error); } finally { setLoading(false); } }; if (loading) { return
Ładowanie dashboard...
; } return (

Dashboard

Przegląd stanu bota i ostatnich aktywności

{/* Stats Cards */}

Serwery

{stats.totalServers}

Wiadomości

{stats.totalMessages}

Użytkownicy

{stats.totalUsers}

Status Bota

{stats.botStatus === 'online' ? 'Online' : 'Offline'}

{/* Quick Actions */}

Szybkie akcje

Zarządzaj serwerami

Konfiguruj kanały i wiadomości

Szablony wiadomości

Wkrótce dostępne

Statystyki

Wkrótce dostępne

{/* Recent Activity */}

Ostatnia aktywność

{recentActivity.length > 0 ? ( recentActivity.map((activity) => (

{activity.description}

{activity.server} • {activity.timestamp.toLocaleString('pl-PL')}

)) ) : (

Brak ostatnich aktywności

)}
{/* Bot Info */}

Informacje o bocie

Wersja

1.0.0

Czas działania

99.5%

Ostatnia aktualizacja

Dzisiaj

); } export default Dashboard;