bbuddy-ui/src/navigation.ts

18 lines
719 B
TypeScript
Raw Normal View History

2023-12-29 15:31:00 +00:00
import { createLocalizedPathnamesNavigation, Pathnames } from 'next-intl/navigation';
2023-12-21 21:22:13 +00:00
import { ALLOWED_LOCALES, LOCALE_PREFIX } from './constants/locale';
export const { Link, redirect, usePathname, useRouter } =
createLocalizedPathnamesNavigation({
locales: ALLOWED_LOCALES,
pathnames: {
2023-12-29 15:31:00 +00:00
'/': '/',
// '/experts': '/experts',
// '/experts/[expertId]': '/experts/[expertId]',
// '/news': '/news',
// '/privacy-policy': '/privacy-policy',
// '/[userId]': '/[userId]',
// '/[userId]/[...slug]': '/[userId]/[...slug]',
2023-12-29 15:31:00 +00:00
} satisfies Pathnames<typeof ALLOWED_LOCALES>,
2023-12-21 21:22:13 +00:00
localePrefix: LOCALE_PREFIX
});