'use client';

import { LayoutDashboard, Menu } from 'lucide-react';
import { useState } from 'react';
import { Button } from '@/components/ui/button';

export function Sidebar() {
  const [isOpen, setIsOpen] = useState(true);

  return (
      <div
        className={`${
          isOpen ? 'w-64' : 'w-20'
        } bg-white border-r border-gray-200 transition-all duration-300 flex flex-col`}
      >
        <div className="p-4 border-b border-gray-200 flex items-center justify-between">
          {isOpen && (
            <div className="flex items-center gap-3">
              <div className="w-10 h-10 bg-gradient-to-br from-blue-400 to-cyan-300 rounded-lg flex items-center justify-center text-white font-bold">
                B
              </div>
              <div>
                <div className="font-bold text-sm text-gray-900">BUKIT</div>
                <div className="text-xs text-gray-500">Recruitment</div>
              </div>
            </div>
          )}
          <Button
            variant="ghost"
            size="sm"
            onClick={() => setIsOpen(!isOpen)}
            className="h-8 w-8 p-0"
          >
            <Menu className="w-4 h-4" />
          </Button>
        </div>

        <nav className="flex-1 p-4 space-y-2">
          <div className="flex items-center gap-3 px-3 py-2 rounded-lg bg-blue-50 text-blue-600">
            <LayoutDashboard className="w-5 h-5 flex-shrink-0" />
            {isOpen && <span className="text-sm font-medium">Dashboard</span>}
          </div>
        </nav>
      </div>
  );
}
