// @flow import React from 'react'; import { Icon, IconCheck } from '../../../icons'; const mainClass = 'toggle-button'; type Props = { /** * Text of the button. */ children: React$Node, /** * If the button is toggled or not. */ isToggled?: boolean, /** * OnClick button handler. */ onClick: Function } /** * Button used as a toggle. * * @returns {ReactElement} */ function ToggleButton({ children, isToggled, onClick }: Props) { const className = isToggled ? `${mainClass} ${mainClass}--toggled` : mainClass; return (
{children}
); } export default ToggleButton;