// Stencil
import { h } from "@stencil/core";
export class PlacePresentationItems {
    constructor() {
        // Props
        this.famousItems = [];
        this.itemsTitle = '';
        this.seeMoreButton = '';
        // States
        this.moreFamousItems = false; // Whether to display more famous items
    }
    ////////////////////////////////////////////////////////////////
    // User Interactions
    ////////////////////////////////////////////////////////////////
    /**
     * Enable the full famous items mode
     */
    displayMoreFamousItems() {
        this.moreFamousItems = true;
    }
    ////////////////////////////////////////////////////////////////
    // Render
    ////////////////////////////////////////////////////////////////
    render() {
        return (h("div", null,
            h("h4", { class: 'place-section-title' }, this.itemsTitle),
            h("div", { class: "item-list-container" }, this.famousItems.map((item, index) => (index < 3 && !this.moreFamousItems || this.moreFamousItems
                ? h("li", null, item)
                : ''))),
            !this.moreFamousItems && this.famousItems.length > 3
                ?
                    h("ion-button", { fill: 'clear', color: 'primary', onClick: () => this.displayMoreFamousItems() },
                        "+ ",
                        this.seeMoreButton)
                :
                    h("br", null)));
    }
    static get is() { return "place-presentation-items"; }
    static get originalStyleUrls() { return {
        "$": ["place-presentation-items.scss"]
    }; }
    static get styleUrls() { return {
        "$": ["place-presentation-items.css"]
    }; }
    static get properties() { return {
        "famousItems": {
            "type": "unknown",
            "mutable": false,
            "complexType": {
                "original": "String[]",
                "resolved": "String[]",
                "references": {
                    "String": {
                        "location": "global"
                    }
                }
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "defaultValue": "[]"
        },
        "itemsTitle": {
            "type": "string",
            "mutable": true,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "items-title",
            "reflect": false,
            "defaultValue": "''"
        },
        "seeMoreButton": {
            "type": "string",
            "mutable": true,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "see-more-button",
            "reflect": false,
            "defaultValue": "''"
        }
    }; }
    static get states() { return {
        "moreFamousItems": {}
    }; }
}
