project setup with core files including configuration, package management, and basic structure. Added .gitignore, README, and various TypeScript types for CMS components. Implemented initial components and layouts for the application.
This commit is contained in:
37
middlelayer/adapters/Mock/_cms/mockNavigation.ts
Normal file
37
middlelayer/adapters/Mock/_cms/mockNavigation.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
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,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user