import Image from "next/image";
import { useAppSelector } from "@/src/redux/hook";

interface ProfileProps {
  imgPath: string;
}

export default function Profile({ imgPath }: ProfileProps) {
  const email = useAppSelector((state) => state.auth.email);

  return (
    <div className="p-4">
      <div className="flex items-center gap-3">
        <div className="relative w-10 h-10 rounded-full overflow-hidden">
          <Image
            src={imgPath || "/images/human-icon.jpg"}
            fill
            style={{ objectFit: "cover" }}
            alt="Profile"
          />
        </div>
        <div>
          <div className="font-medium text-[#464255] text-[16px]">
            Administrator
          </div>
          <div className="text-sm text-black text-[10px]">{email || "N/A"}</div>
        </div>
      </div>
    </div>
  );
}
