Skip to content

Instantly share code, notes, and snippets.

@pfftdammitchris
Created January 13, 2020 23:02
Show Gist options
  • Save pfftdammitchris/018730d6f42aa06499264a6dbdd16f48 to your computer and use it in GitHub Desktop.
Save pfftdammitchris/018730d6f42aa06499264a6dbdd16f48 to your computer and use it in GitHub Desktop.
import React from 'react'
import {
EditIcon,
DeleteIcon,
ResetIcon,
TrashIcon,
UndoIcon,
} from '../lib/icons'
import * as utils from '../utils
export const audioExts = ['mp3', 'mpa', 'ogg', 'wav']
const icons = {
edit: {
component: EditIcon,
onClick: () => window.alert('You clicked the edit component'),
name: 'edit',
},
delete: {
component: DeleteIcon,
name: 'delete',
},
// Audio icons
// IIFE returning an object
...(function() {
return audioExts.reduce((acc, ext) => {
acc[ext] = {
component: MdAudiotrack,
title: 'Audio Track',
}
return acc
})(),
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment