Component({
    properties: {
        currentTypeName: {
            type: String,
            value: '',
        },
        typeActions: {
            type: Array,
            value: [],
        },
    },

    data: {
        showSelector: false,
    },

    methods: {
        onShowSelector() {
            this.setData({ showSelector: true });
        },

        onClose() {
            this.setData({ showSelector: false });
        },

        onSelect(event: any) {
            const { name, value } = event.detail;
            this.setData({ showSelector: false });
            this.triggerEvent('select', { name, value });
        },

        onRandom() {
            this.triggerEvent('random');
        },
    },
});
