import { useMediaQuery } from '@material-ui/core'; import ConditionallyRender from '../ConditionallyRender'; import PermissionButton from '../PermissionButton/PermissionButton'; import PermissionIconButton from '../PermissionIconButton/PermissionIconButton'; interface IResponsiveButtonProps { Icon: React.ElementType; onClick: () => void; tooltip?: string; disabled?: boolean; permission?: string; projectId?: string; environmentId?: string; maxWidth: string; } const ResponsiveButton: React.FC = ({ Icon, onClick, maxWidth, tooltip, disabled = false, children, permission, environmentId, projectId, ...rest }) => { const smallScreen = useMediaQuery(`(max-width:${maxWidth})`); return ( } elseShow={ {children} } /> ); }; export default ResponsiveButton;