"use client";

import { useRouter } from "next/navigation";

export default function HeadBack() {
  const router = useRouter();

  // 页面回退
  const handleBack = () => {
    router.back();
  };

  return (
    <div className="relative flex items-center bg-[#eee] justify-between px-4 py-4  border-t-0">
      <svg
        className=" leading-none focus:outline-none w-6 h-6"
        onClick={handleBack}
        viewBox="0 0 1024 1024"
        version="1.1"
        xmlns="http://www.w3.org/2000/svg"
        p-id="111033"
        width="200"
        height="200"
      >
        <path
          d="M391.466667 512l339.882666-339.882667a46.592 46.592 0 1 0-65.877333-65.877333L292.693333 479.061333a46.592 46.592 0 0 0 0 65.877334l372.821334 372.821333a46.592 46.592 0 1 0 65.877333-65.877333L391.466667 512z"
          p-id="111034"
        ></path>
      </svg>

      {/* 标题文字 */}
      <h1 className="absolute left-1/2 -translate-x-1/2 text-black text-xl font-bold tracking-wider">
        ASTERIA
      </h1>

      {/* 占位，保证标题居中 */}
      <div className="w-12"></div>
    </div>
  );
}
