import {type Html, html} from "../../../../common/html.js"; import * as t from "../../../../common/translation-util.js"; import type {NavigationItem} from "../../../../common/types.js"; import {generateNodeFromHtml} from "../../components/base.js"; type PreferenceNavigationProperties = { $root: Element; onItemSelected: (navigationItem: NavigationItem) => void; }; export default class PreferenceNavigation { navigationItems: NavigationItem[]; $el: Element; constructor(private readonly properties: PreferenceNavigationProperties) { this.navigationItems = [ "General", "Network", "AddServer", "Organizations", "Shortcuts", ]; this.$el = generateNodeFromHtml(this.templateHtml()); this.properties.$root.append(this.$el); this.registerListeners(); } templateHtml(): Html { const navigationItemsHtml = html``.join( this.navigationItems.map( (navigationItem) => html`
`, ), ); return html`