import { useRouter } from "next/dist/client/router" ; const LanguageSelector = ( ) => { const router = useRouter ( ) ; return ( < > < label > language : < /label> < select value = { router . locale } onChange = { ( event ) => { router . push ( { pathname : router . pathname , query : router . query } , router . asPath , { locale : event . target . value } ) ; } } > { } { router . locales ?. map ( ( locale ) => ( < option key = { locale } value = { locale } > { locale } < /option>))} < /select> < />); } ; export default LanguageSelector ;