import h, { classNames } from 'lib/h' interface Params { initBeats: number, onRemove: (index: number) => void, onAdd: (index: number) => void } export function view({ initBeats, onRemove, onAdd }: Params) { let beats = initBeats return h('div', { className: 'g-Sequencer__Buttons' }, h('button', { onclick: () => { if (beats > 1) { beats -= 1 onRemove(beats) } } }, 'Remove Beat' ), h('button', { onclick: () => { onAdd(beats) beats += 1 } }, 'Add Beat' ) ) }