import bubbleEvent from '../shared/bubble-event.js'
import h from '../shared/h.js'

export function Audio ({ _model, ...props }) {
  const { src, caption } = _model

  return h('div', { ...props, className: undefined },
    h('audio', {
      controls: true,
      src,
      className: 'w-full block',
      title: caption,
      onTimeUpdate: bubbleEvent
    })
  )
}
