Migrating from router-dom to nextJs router

import {Link} from “react-router-dom”

import Link from “next/link”

import {useNavigate} from “react-router-dom”;

import {useRouter} from “next/router”;

const navigate = useNavigate()

const router = useRouter()

search navigate(‘blahblah’

router.push({
pathname: ‘/catalog-source’
})

const { code } = useParams();

to replace by new dynamic route for nextjs

<FlashMessages /> to be moved either on layout.tsx or on _app.tsx