import React from 'react'
import { Navigate } from 'react-router-dom'

const Welcome = () => {
  const token = localStorage.getItem('token')
  if (!token) return <Navigate to="/" replace />

  return (
    <div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-olive-50 to-olive-100">
      <div className="bg-white rounded-2xl shadow-lg p-10 max-w-md text-center">
        <div className="w-20 h-20 bg-olive-100 rounded-full flex items-center justify-center mx-auto mb-6">
          <span className="text-4xl">🌵</span>
        </div>
        <h1 className="text-3xl font-bold text-gray-800 mb-2">Welcome to Cactus</h1>
        <p className="text-gray-500 mb-8">Your stock management system</p>
        <a
          href="/dashboard"
          className="inline-block bg-olive-600 hover:bg-olive-700 text-white px-8 py-3 rounded-xl font-medium transition shadow-md"
        >
          Go to Dashboard
        </a>
      </div>
    </div>
  )
}

export default Welcome