feat(help-page): enhance help section with dynamic footer links and add pending help page
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
import { Menu } from './tenant.interface';
|
||||
|
||||
const MENU_LABELS: Record<string, string> = {
|
||||
'help.faq': 'Preguntas frecuentes',
|
||||
'help.contact': 'Contacto',
|
||||
'help.payment-methods': 'Medios de pago',
|
||||
'help.shipping': 'Envíos',
|
||||
'help.terms-and-conditions': 'Términos y condiciones',
|
||||
};
|
||||
|
||||
export function findMenu(menues: readonly Menu[], menuCode: string): Menu | undefined {
|
||||
for (const menu of menues) {
|
||||
if (menu.code === menuCode) {
|
||||
@@ -15,3 +23,15 @@ export function findMenu(menues: readonly Menu[], menuCode: string): Menu | unde
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function getMenuLabel(menu: Menu): string {
|
||||
const configuredLabel = MENU_LABELS[menu.code];
|
||||
|
||||
if (configuredLabel) {
|
||||
return configuredLabel;
|
||||
}
|
||||
|
||||
const label = menu.code.split('.').at(-1)?.replaceAll('-', ' ') ?? menu.code;
|
||||
|
||||
return label.charAt(0).toUpperCase() + label.slice(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user