"use client"; import { useEffect, useState } from 'react'; import { getUser } from '@/lib/auth'; import { RocketLaunchIcon, ChartBarIcon, BriefcaseIcon, LifebuoyIcon, CreditCardIcon, DocumentTextIcon, FolderIcon, ShareIcon, ArrowTrendingUpIcon, ArrowTrendingDownIcon, CheckCircleIcon, ClockIcon, } from '@heroicons/react/24/outline'; export default function DashboardPage() { const [userName, setUserName] = useState(''); const [greeting, setGreeting] = useState(''); useEffect(() => { const user = getUser(); if (user) { setUserName(user.name.split(' ')[0]); // Primeiro nome } const hour = new Date().getHours(); if (hour >= 5 && hour < 12) setGreeting('Bom dia'); else if (hour >= 12 && hour < 18) setGreeting('Boa tarde'); else setGreeting('Boa noite'); }, []); const overviewStats = [ { name: 'Receita Total (Mês)', value: 'R$ 124.500', change: '+12%', changeType: 'increase', icon: ChartBarIcon, color: 'green' }, { name: 'Novos Leads', value: '45', change: '+5%', changeType: 'increase', icon: RocketLaunchIcon, color: 'blue' }, { name: 'Projetos Ativos', value: '12', change: '-1', changeType: 'decrease', icon: BriefcaseIcon, color: 'purple' }, { name: 'Chamados Abertos', value: '3', change: '-2', changeType: 'decrease', icon: LifebuoyIcon, color: 'orange' }, ]; const modules = [ { title: 'CRM & Vendas', icon: RocketLaunchIcon, color: 'blue', stats: [ { label: 'Propostas Enviadas', value: '8' }, { label: 'Aguardando Aprovação', value: '3' }, { label: 'Taxa de Conversão', value: '24%' }, ] }, { title: 'Financeiro & ERP', icon: ChartBarIcon, color: 'green', stats: [ { label: 'A Receber', value: 'R$ 45.200' }, { label: 'A Pagar', value: 'R$ 12.800' }, { label: 'Fluxo de Caixa', value: 'Positivo' }, ] }, { title: 'Projetos & Tarefas', icon: BriefcaseIcon, color: 'purple', stats: [ { label: 'Em Andamento', value: '12' }, { label: 'Atrasados', value: '1' }, { label: 'Concluídos (Mês)', value: '4' }, ] }, { title: 'Helpdesk', icon: LifebuoyIcon, color: 'orange', stats: [ { label: 'Novos Chamados', value: '3' }, { label: 'Tempo Médio Resposta', value: '2h' }, { label: 'Satisfação', value: '4.8/5' }, ] }, { title: 'Documentos & Contratos', icon: DocumentTextIcon, color: 'indigo', stats: [ { label: 'Contratos Ativos', value: '28' }, { label: 'A Vencer (30 dias)', value: '2' }, { label: 'Docs Armazenados', value: '1.2GB' }, ] }, { title: 'Redes Sociais', icon: ShareIcon, color: 'pink', stats: [ { label: 'Posts Agendados', value: '14' }, { label: 'Engajamento', value: '+8.5%' }, { label: 'Novos Seguidores', value: '120' }, ] } ]; return (
Aqui está o resumo da sua agência hoje. Tudo parece estar sob controle.
{stat.name}
{stat.value}