'use client'

import { useRouter } from 'next/navigation'
import { AUTH_LOGIN_URL } from '@/config/routes'

type Props = {
  children: React.ReactNode
  mode?: 'modal' | 'redirect'
  asChild?: boolean
}

const LoginButton = ({
  children, mode = 'redirect', asChild,
}: Props) => {
  const router = useRouter()
  const onClick = () => router.push(AUTH_LOGIN_URL)

  if (mode === 'modal') {
    return <span>TODO: Implement modal</span>
  }

  return <span onClick={onClick} className="cursor-pointer">{children}</span>
}

export default LoginButton
