1import { useRouter } from 'next/router'
2
3function ActiveLink({ children, href }) {
4 const router = useRouter()
5
6 const handleClick = (e) => {
7 e.preventDefault()
8 router.push(href)
9 }
10
11 return (
12 <a href={href} onClick={handleClick} style={style}>
13 {children}
14 </a>
15 )
16}
17
18export default ActiveLink
19