'use client'

import { usePathname } from 'next/navigation'

export default function FloatBtn() {
  const pathname = usePathname()

  const scrollToTop = () => {
    window.scrollTo({
      top: 0,
      behavior: 'smooth',
    })
  }

  if (pathname === '/login' || pathname === '/') {
    return null
  }

  return <button className="top-btn" onClick={scrollToTop}></button>
}
