"use client";

import { useRouter } from "next/navigation";

export default function OrderHeader({ title }: { title: string }) {
  const router = useRouter();
  return (
    <div className="sticky top-0 z-50 bg-white px-5 py-4 border-b">
      <div className="flex items-center w-full">
        <button onClick={() => router.back()} className="text-xl">
          <svg
            className="w-6 h-6"
            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>
        </button>
        <h1 className="flex-grow text-center text-lg font-bold">{title}</h1>
      </div>
    </div>
  );
}
