import 'server-only';

import arHomepage from '@/content/locales/ar/homepage.json';
import arShell from '@/content/locales/ar/shell.json';
import enHomepage from '@/content/locales/en/homepage.json';
import enShell from '@/content/locales/en/shell.json';
import frHomepage from '@/content/locales/fr/homepage.json';
import frShell from '@/content/locales/fr/shell.json';
import type { Locale } from './config';

export type HomepageMessages = typeof enHomepage;
export type ShellMessages = typeof enShell;
export interface Messages {
  homepage: HomepageMessages;
  shell: ShellMessages;
}

const messages = {
  en: { homepage: enHomepage, shell: enShell },
  fr: { homepage: frHomepage, shell: frShell },
  ar: { homepage: arHomepage, shell: arShell },
} satisfies Record<Locale, Messages>;

export function getMessages(locale: Locale): Messages {
  return messages[locale];
}
