summaryrefslogtreecommitdiff
path: root/src/components/app/timeline/PlayButtonComponent.js
blob: 2b8e5328c14865b772c68a609ed7f1c50c18ed31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import React from "react";

const PlayButtonComponent = ({isPlaying, currentTick, lastSimulatedTick, onPlay, onPause}) => (
    <div className="play-btn" onClick={() => {
        if (isPlaying) {
            onPause();
        } else {
            if (currentTick !== lastSimulatedTick) {
                onPlay();
            }
        }
    }}>
        {isPlaying ?
            <span className="fa fa-pause"/> :
            <span className="fa fa-play"/>
        }
    </div>
);

export default PlayButtonComponent;