import { CaretDown } from "@icons/CaretDown";

export const ScrollToTop = () => {
  const html = document.querySelector("html");
  const top = () =>
    html?.scrollTo({
      left: 0,
      top: 0,
      behavior: "smooth",
    });
  return (
    <button
      onClick={top}
      class={`h-full w-full flex items-center justify-center`}
    >
      <CaretDown className="rotate-180 h-8 w-8" />
    </button>
  );
};
