import type { AppLanguage } from "./constants";

/**
 * Pages that should switch to LTR layout when language is English.
 * LTR styling will be applied page-by-page in a later pass.
 */
export const LTR_WHEN_ENGLISH_PREFIXES = [
  "/",
  "/reels",
  "/explore",
  "/settings/chats",
  "/settings/chats/rooms",
  "/academy",
  "/projects",
  "/new-project",
  "/billboards",
  "/settings",
  "/settings/workroom",
  "/users",
] as const;

export function shouldUseLtrLayout(
  pathname: string,
  language: AppLanguage
): boolean {
  if (language !== "en") return false;

  const path = pathname.split("?")[0] || "/";

  return LTR_WHEN_ENGLISH_PREFIXES.some((prefix) => {
    if (prefix === "/") return path === "/";
    return path === prefix || path.startsWith(`${prefix}/`);
  });
}
