File size: 1,106 Bytes
24477c9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3c90ca7
 
24477c9
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { getLang } from "@/lib/i18n"

/** The official page for a modality's models: every language release links to M Plan, every
 *  video and image release to the H3 Family page. English goes to minimax.io, Chinese to the
 *  same pages on minimax.cn. Shown as a button on each release's page and in the Models menu.
 *  Keys are category keys (org.CATEGORY_NAME). */
const PAGE: Record<string, { label: string; path: string }> = {
  language: { label: "M Plan", path: "/m-plan" },
  video: { label: "H3 Family", path: "/h3-family" },
  image: { label: "H3 Family", path: "/h3-family" },
}

const site = () => (getLang() === "zh" ? "https://www.minimax.cn" : "https://www.minimax.io")

export function officialPage(cat: string): { label: string; href: string } | undefined {
  const p = PAGE[cat]
  return p && { label: p.label, href: site() + p.path }
}

/** The same pages once each, for the menu (H3 Family first, as the video category leads the page). */
export const officialLinks = () =>
  [...new Map(["video", "image", "language"].map((c) => officialPage(c)!).map((l) => [l.href, l])).values()]