29 lines
750 B
Plaintext
29 lines
750 B
Plaintext
import Component from '@glimmer/component';
|
|
import { service } from '@ember/service';
|
|
import SiteLinksGroup from './site-links/group.gjs';
|
|
|
|
export default class SiteLinksComponent extends Component {
|
|
@service sites;
|
|
@service notifications;
|
|
|
|
get groups() {
|
|
return this.sites.groups.map((group) => ({
|
|
id: group.id,
|
|
items: group.items.map((site) => ({
|
|
...site,
|
|
...this.notifications.stateFor(site),
|
|
})),
|
|
}));
|
|
}
|
|
|
|
<template>
|
|
{{#if this.groups.length}}
|
|
<div class="flex items-start gap-4" data-test-site-links ...attributes>
|
|
{{#each this.groups as |group|}}
|
|
<SiteLinksGroup @id={{group.id}} @items={{group.items}} />
|
|
{{/each}}
|
|
</div>
|
|
{{/if}}
|
|
</template>
|
|
}
|