38 lines
1023 B
TypeScript
38 lines
1023 B
TypeScript
import type { Navigation } from "../../../types/cms/Navigation";
|
|
import type { Link } from "../../../types/cms/Link";
|
|
import type { Page } from "../../../types/cms/Page";
|
|
import { generateMockPages } from "./mockPage";
|
|
|
|
/**
|
|
* Generiert Mock-Navigation mit locale-spezifischen Inhalten
|
|
* @param locale - Die gewünschte Locale ("de" oder "en")
|
|
*/
|
|
export function generateMockNavigation(locale: string = "de"): Navigation {
|
|
const isEn = locale === "en";
|
|
const pages = generateMockPages(locale);
|
|
|
|
// Erstelle Links basierend auf den Pages
|
|
const links: Array<{ fields: Link | Page }> = [
|
|
{
|
|
fields: pages["/"] as Page,
|
|
},
|
|
{
|
|
fields: pages["/about"] as Page,
|
|
},
|
|
{
|
|
fields: {
|
|
name: isEn ? "Products" : "Produkte",
|
|
internal: "products",
|
|
linkName: isEn ? "Products" : "Produkte",
|
|
url: "/products",
|
|
} as Link,
|
|
},
|
|
];
|
|
|
|
return {
|
|
name: isEn ? "Main Navigation" : "Hauptnavigation",
|
|
internal: "main-nav",
|
|
links: links as any,
|
|
};
|
|
}
|