import { getTranslations } from "next-intl/server";

import { PeriodKeyVariant, PeriodType } from "@/types/period";

export const getPeriodTextServer = async (
  periodType: PeriodType,
  count: number,
  periodKeyVariant: PeriodKeyVariant = "period"
): Promise<string> => {
  const t = await getTranslations(periodKeyVariant);

  return t(periodType.toLowerCase(), { count });
};
