import React from 'react'; import { styled, IconButton } from '@mui/material'; import { Tooltip } from '../../common/Tooltip'; const StyledIconButton = styled(IconButton)` display: flex; cursor: pointer; width: 30px; height: 30px; margin: -8px; `; type Props = React.ComponentProps & { tooltip?: React.ReactNode; }; export const ControlsButton: React.FC = function ControlsButton({ children, className, onClick, tooltip, ...props }) { const content = ( {children} ); return tooltip && !props.disabled ? ( {content} ) : ( content ); };