An easy-to-use platform for EEG experimentation in the classroom
at main 24 lines 583 B view raw
1import React, { PureComponent } from 'react'; 2import { Button } from './ui/button'; 3 4interface Props { 5 isPreviewing: boolean; 6 onClick: (event: React.MouseEvent<HTMLButtonElement>) => void; 7} 8 9export default class PreviewButton extends PureComponent<Props> { 10 render() { 11 if (!this.props.isPreviewing) { 12 return ( 13 <Button variant="secondary" onClick={this.props.onClick}> 14 Preview Experiment 15 </Button> 16 ); 17 } 18 return ( 19 <Button variant="destructive" onClick={this.props.onClick}> 20 Stop Preview 21 </Button> 22 ); 23 } 24}