"use client";

import { usePathname } from "next/navigation";
import Link from "next/link";

export default function LoginLayout({ children }) {
  const pathname = usePathname();
  return (
    <section className="flex flex-1 flex-col items-center">
      <img
        src={process.env.NEXT_PUBLIC_CDN_URL + "/public/images/slogan.png"}
        alt=""
        className="mt-24 w-96"
      />
      <div className="flex mt-4 h-10 justify-center">
        <div className="tabs tab-boxed w-72">
          <Link
            className={`tab basis-1/2 ${
              pathname === "/auth/login/phonenumlogin"
                ? "tab-active text-[#FF669E] bg-[#FF61B030] rounded-full"
                : "text-[#FFFFFF80]"
            }`}
            href="phonenumlogin"
            replace
          >
            手机号登录
          </Link>
          <Link
            className={`tab basis-1/2 ${
              pathname === "/auth/login/passwordlogin"
                ? "tab-active text-[#FF669E] bg-[#FF61B030] rounded-full"
                : "text-[#FFFFFF80]"
            }`}
            href="passwordlogin"
            replace
          >
            账号密码登录
          </Link>
        </div>
      </div>
      <div className="flex">{children}</div>
    </section>
  );
}
