module.exports = function (self) {
    self.setActionDefinitions({
        sample_action: {
            name: 'Trigger Pad',
            options: [
                {
                    id: 'name',
                    type: 'textinput',
                    label: 'Pad Name',
                    default: '',
                },
            ],
            callback: async (event) => {
                const pad = self.currentProject.findPadByName(event.options.name);
                if (!pad) {
                    self.log('warning', 'Cannot find a pad with name ' + event.options.name);
                }
                const payload = {
                    'pad': pad.id
                };
                self.sendToWebSocket('cart-action', payload)
            },
        },
    })
}