openreplay/frontend/app/components/Session/Layout/Player/ControlButton.js
Shekar Siri 2ed5cac986
Webpack upgrade and dependency cleanup (#523)
* change(ui) - webpack update
* change(ui) - api optimize and other fixes
2022-06-03 16:47:38 +02:00

20 lines
715 B
JavaScript

import React from 'react';
import cn from 'classnames';
import { Icon } from 'UI';
import stl from './controlButton.module.css';
export default function ControlButton({ label, icon, onClick, disabled=false, count = 0, hasErrors=false, active=false }) {
return (
<button
className={ cn(stl.controlButton, { [stl.disabled]: disabled, [stl.active]: active }) }
onClick={ onClick }
>
<div className="relative">
{ count > 0 && <div className={ stl.countLabel }>{ count }</div>}
{ hasErrors && <div className={ stl.errorSymbol } /> }
<Icon name={ icon } size="20" color="gray-dark"/>
</div>
<span className={ stl.label }>{ label }</span>
</button>
);
}