Fix runttime
This commit is contained in:
+5
-1
@@ -1,4 +1,4 @@
|
||||
import type { ContactContent } from "@/content/types";
|
||||
import type { ContactContent, ModeVariants } from "@/content/types";
|
||||
|
||||
const FALLBACK_SITE_URL = "https://example.com";
|
||||
const SITE_MODES = ["coming-soon", "full"] as const;
|
||||
@@ -60,6 +60,10 @@ export function isComingSoonMode(): boolean {
|
||||
return getSiteMode() === "coming-soon";
|
||||
}
|
||||
|
||||
export function getModeValue<T>(variants: ModeVariants<T>): T {
|
||||
return variants[getSiteMode()];
|
||||
}
|
||||
|
||||
export function getLocalizedPath(pathname: string, locale: "ar" | "en"): string {
|
||||
const normalizedPath = pathname === "/" ? "" : pathname;
|
||||
return `/${locale}${normalizedPath}`;
|
||||
|
||||
Reference in New Issue
Block a user