JSFiddle - React, Tailwind, and code Playground

by Hugo Carneiro

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.min.js"></script>

JavaScript

var textToCopy = 'Hello'
var data = {
	title: 'Something',
  labels: [
    {
      label: 'Copy',
      type: 'copyText',
      action: {
        text: textToCopy
      }
    },
    {
      label: 'Edit',
      action: function (i) { console.log('here') }
    },
  ]
};


var buttonLabels = _.map(data.labels, function(label) {
	return _.pick(label, ['label', 'type'])
});
console.log(buttonLabels);