import { defineRouting } from "next-intl/routing";
import { createNavigation } from "next-intl/navigation";

export const routing = defineRouting({
  locales: ["fa", "ar", "en"],
  defaultLocale: "fa",
  // Iran-first: don't auto-pick the locale from the browser's Accept-Language
  // (Persian users often have an en-US browser). A locale-less URL defaults to
  // fa; the locale is otherwise taken from the URL prefix or the marketing-site
  // link (e.g. app.meezi.ir/fa/login).
  localeDetection: false,
});

export const { Link, redirect, usePathname, useRouter } =
  createNavigation(routing);
