feat: add secure login page with jwt authentication and button animation

This commit is contained in:
Cauê Faleiros
2026-05-04 15:46:08 -03:00
parent c64b7b580d
commit b1e8cc55df
9 changed files with 335 additions and 17 deletions

View File

@@ -1,8 +1,8 @@
import { useState, useEffect } from 'react';
import { Outlet, Link, useLocation } from 'react-router-dom';
import { LayoutDashboard, Users, BarChart3, ChevronLeft, ChevronRight, Package, Loader2 } from 'lucide-react';
import { LayoutDashboard, Users, BarChart3, ChevronLeft, ChevronRight, Package, Loader2, LogOut } from 'lucide-react';
import type { DateRange, OrderData } from '../types';
import { fetchData } from '../dataService';
import { fetchData, logout } from '../dataService';
const Layout = () => {
const location = useLocation();
@@ -102,6 +102,16 @@ const Layout = () => {
);
})}
</nav>
<div className="p-4 border-t border-dark-border">
<button
onClick={logout}
className={`w-full flex items-center text-red-500 hover:bg-red-500/10 px-4 py-3 rounded-xl transition-all ${isSidebarCollapsed ? 'justify-center' : 'space-x-3'}`}
>
<LogOut className="w-5 h-5 shrink-0" />
{!isSidebarCollapsed && <span className="font-medium">Sair</span>}
</button>
</div>
</aside>
{/* Main Content */}