import React from 'react';
import { NavLink, useLocation } from 'react-router-dom';
import { FaTachometerAlt, FaFilm, FaUsers, FaHeadset, FaTrophy, FaLightbulb } from 'react-icons/fa';

const AdminSidebar = () => {
  const location = useLocation();

  const isActive = (path) => {
    if (path === '/admin') {
      return location.pathname === '/admin';
    }
    return location.pathname.startsWith(path);
  };

  return (
    <div className="w-64 bg-campfire-charcoal border-r border-campfire-ash/20 h-screen fixed left-0 top-0 pt-16">
      <nav className="p-4">
        <NavLink
          to="/admin/"
          className={({ isActive }) =>
            `flex items-center space-x-2 px-4 py-2 rounded-lg mb-2 transition-colors ${
              isActive ? 'bg-campfire-amber/20 text-campfire-amber' : 'text-campfire-light hover:bg-campfire-ash/20'
            }`
          }
        >
          <FaTachometerAlt className="w-5 h-5" />
          <span>Главная</span>
        </NavLink>

        <NavLink
          to="/admin/media"
          className={({ isActive }) =>
            `flex items-center space-x-2 px-4 py-2 rounded-lg mb-2 transition-colors ${
              isActive ? 'bg-campfire-amber/20 text-campfire-amber' : 'text-campfire-light hover:bg-campfire-ash/20'
            }`
          }
        >
          <FaFilm className="w-5 h-5" />
          <span>Медиа</span>
        </NavLink>

        <NavLink
          to="/admin/users"
          className={({ isActive }) =>
            `flex items-center space-x-2 px-4 py-2 rounded-lg mb-2 transition-colors ${
              isActive ? 'bg-campfire-amber/20 text-campfire-amber' : 'text-campfire-light hover:bg-campfire-ash/20'
            }`
          }
        >
          <FaUsers className="w-5 h-5" />
          <span>Пользователи</span>
        </NavLink>

        <NavLink
          to="/admin/support"
          className={({ isActive }) =>
            `flex items-center space-x-2 px-4 py-2 rounded-lg mb-2 transition-colors ${
              isActive ? 'bg-campfire-amber/20 text-campfire-amber' : 'text-campfire-light hover:bg-campfire-ash/20'
            }`
          }
        >
          <FaHeadset className="w-5 h-5" />
          <span>Поддержка</span>
        </NavLink>

        <NavLink
          to="/admin/achievements"
          className={({ isActive }) =>
            `flex items-center space-x-2 px-4 py-2 rounded-lg mb-2 transition-colors ${
              isActive ? 'bg-campfire-amber/20 text-campfire-amber' : 'text-campfire-light hover:bg-campfire-ash/20'
            }`
          }
        >
          <FaTrophy className="w-5 h-5" />
          <span>Достижения</span>
        </NavLink>

        <NavLink
          to="/admin/suggestions"
          className={({ isActive }) =>
            `flex items-center space-x-2 px-4 py-2 rounded-lg mb-2 transition-colors ${
              isActive ? 'bg-campfire-amber/20 text-campfire-amber' : 'text-campfire-light hover:bg-campfire-ash/20'
            }`
          }
        >
          <FaLightbulb className="w-5 h-5" />
          <span>Предложения</span>
        </NavLink>
      </nav>
    </div>
  );
};

export default AdminSidebar; 