NextJs Check Path di halaman

import { useRouter } from 'next/router'

export default function Component() {
  const router = useRouter()
  console.log( router.pathname );
KostasX