 import { Link } from "react-router-dom";

function Dashboard () {
    const handleLogout = () => {
        
        localStorage.removeItem("token"); 
        window.location.href = "/login";
    }

    return (
        <div className="p-6 max-w-7xl mx-auto space-y-6">
            <h2  className="text-2xl md:text-3xl font-extrabold text-slate-800 text-center tracking-wide max-w-2xl">Welcome to Sales Management System</h2>
            <p>⬇️</p>
            <p className="font-medium">Use the navigation bar above or the quick links below to manage the store data.</p>
            
            <div className="grid grid-cols-1 sm:grid-cols-2 gap-4 w-full max-w-2xl mt-4">
                <Link to="/customer"  className="bg-white p-6 rounded shadow-sm border border-slate-200 text-center font-bold
                 text-slate-700 hover:border-blue-500 hover:text-blue-500 transition-all">Customer</Link>
                <Link to="/product"  className="bg-white p-6 rounded shadow-sm border border-slate-200 text-center font-bold
                 text-slate-700 hover:border-blue-500 hover:text-blue-500 transition-all">Product</Link>
                <Link to="/sale"  className="bg-white p-6 rounded shadow-sm border border-slate-200 text-center font-bold
                 text-slate-700 hover:border-blue-500 hover:text-blue-500 transition-all">Sale</Link>
                <Link to="/reports"  className="bg-white p-6 rounded shadow-sm border border-slate-200 text-center font-bold text-slate-700
                 hover:border-blue-500 hover:text-blue-500 transition-all">Reports</Link>
            </div>
            
            <button onClick={handleLogout} className="bg-red-500 px-3 py-1 rounded text-sm hover:bg-red-600">LOGOUT</button>
        </div>
    )
}
export default Dashboard;
