2020-05-28 10:32:57 -05:00
|
|
|
import Component from "@ember/component";
|
2024-01-16 17:51:44 +01:00
|
|
|
import { isEmpty } from "@ember/utils";
|
2024-11-29 15:42:50 +00:00
|
|
|
import { classNames } from "@ember-decorators/component";
|
2025-02-06 16:57:53 +00:00
|
|
|
import discourseComputed from "discourse/lib/decorators";
|
2025-06-05 12:40:13 +02:00
|
|
|
import { i18n } from "discourse-i18n";
|
|
|
|
|
import ProductItem from "./product-item";
|
2019-11-14 09:47:15 +11:00
|
|
|
|
2024-11-29 15:42:50 +00:00
|
|
|
@classNames("product-list")
|
|
|
|
|
export default class ProductList extends Component {
|
2020-05-28 10:32:57 -05:00
|
|
|
@discourseComputed("products")
|
|
|
|
|
emptyProducts(products) {
|
|
|
|
|
return isEmpty(products);
|
2024-11-29 15:42:50 +00:00
|
|
|
}
|
2025-06-05 12:40:13 +02:00
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
{{#if this.emptyProducts}}
|
|
|
|
|
<p>{{i18n "discourse_subscriptions.subscribe.no_products"}}</p>
|
|
|
|
|
{{else}}
|
|
|
|
|
{{#each this.products as |product|}}
|
|
|
|
|
<ProductItem @product={{product}} @isLoggedIn={{this.isLoggedIn}} />
|
|
|
|
|
{{/each}}
|
|
|
|
|
{{/if}}
|
|
|
|
|
</template>
|
2024-11-29 15:42:50 +00:00
|
|
|
}
|