discourse/app/assets/javascripts/admin/addon/components/admin-plugin-config-top-nav.gjs
Jarek Radosz 038e5deb2a
DEV: Clean up imports (#28060)
* `@ember/owner` instead of `@ember/application`
* `discourse-i18n` instead of `I18n`
* `{ service } from "@ember/service"` instead of `inject as service`
2024-07-25 15:09:06 +02:00

37 lines
1.1 KiB
Plaintext

import Component from "@glimmer/component";
import { service } from "@ember/service";
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>
<div class="admin-nav-submenu">
<HorizontalOverflowNav
class="plugin-nav admin-plugin-config-page__top-nav"
>
{{#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>
}