summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/editor/align/components/player/playButton.component.js
blob: f411941dd8693e45e67dc6787e4cc8aa42d293bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import React from 'react'

import actions from 'app/actions'

const PlayButton = ({ playing, onClick }) => {
  return (
    <div
      className={playing ? 'playButton playing' : 'playButton paused'}
      onClick={() => {
        if (onClick) {
          onClick(playing)
        } else if (playing) {
          actions.audio.pause()
        } else {
          actions.audio.play()
        }
      }}
    />
  )
}

export default PlayButton