2024-05-02 09:36:46 +08:00
|
|
|
import Component from "@glimmer/component";
|
2024-07-25 21:09:06 +08:00
|
|
|
import { service } from "@ember/service";
|
2024-05-02 09:36:46 +08:00
|
|
|
import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav";
|
|
|
|
import NavItem from "discourse/components/nav-item";
|
|
|
|
import i18n from "discourse-common/helpers/i18n";
|
|
|
|
|
|
|
|
export default class AdminPluginConfigTopNav extends Component {
|
|
|
|
@service adminPluginNavManager;
|
|
|
|
|
|
|
|
linkText(navLink) {
|
|
|
|
if (navLink.label) {
|
|
|
|
return i18n(navLink.label);
|
|
|
|
} else {
|
|
|
|
return navLink.text;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
<template>
|
2024-05-29 10:20:55 +08:00
|
|
|
<div class="admin-nav-submenu">
|
2024-05-02 09:36:46 +08:00
|
|
|
<HorizontalOverflowNav
|
2024-05-29 10:20:55 +08:00
|
|
|
class="plugin-nav admin-plugin-config-page__top-nav"
|
2024-05-02 09:36:46 +08:00
|
|
|
>
|
|
|
|
{{#each this.adminPluginNavManager.currentConfigNav.links as |navLink|}}
|
|
|
|
<NavItem
|
|
|
|
@route={{navLink.route}}
|
|
|
|
@i18nLabel={{this.linkText navLink}}
|
|
|
|
title={{this.linkText navLink}}
|
|
|
|
class="admin-plugin-config-page__top-nav-item"
|
|
|
|
>
|
|
|
|
{{this.linkText navLink}}
|
|
|
|
</NavItem>
|
|
|
|
{{/each}}
|
|
|
|
</HorizontalOverflowNav>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
}
|