"use client";

import { usePathname } from "next/navigation";
import "./ProfileNav.scss";
import Link from "next/link";
import { signOut } from "next-auth/react";

const ProfileNav = () => {
  const pathname = usePathname();
  return (
    <div className="profile-nav">
      <div className="profile-nav__links">
        <Link
          style={{
            textDecoration: `${
              pathname === "/profile/personal-data" ? "underline" : ""
            }`,
          }}
          href="/profile/personal-data"
        >
          Личные данные
        </Link>
        <div className="profile-nav__links_right">
          <Link
            style={{
              textDecoration: `${
                pathname === "/profile/my-reports" ? "underline" : ""
              }`,
            }}
            href="/profile/my-reports"
          >
            Мои обращения
          </Link>
          <div>3</div>
        </div>
      </div>
      <button
        onClick={() =>
          signOut({
            callbackUrl: "/",
          })
        }
        className="profile-nav__logout"
      >
        Выйти из аккаунта
      </button>
    </div>
  );
};

export default ProfileNav;
