import React from 'react'; import { useMediaQuery } from '@mui/material'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import PermissionButton from 'component/common/PermissionButton/PermissionButton'; import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton'; import { ITooltipResolverProps } from '../TooltipResolver/TooltipResolver'; interface IResponsiveButtonProps { Icon: React.ElementType; endIcon?: React.ReactNode; tooltipProps?: Omit; onClick: () => void; disabled?: boolean; permission: string | string[]; projectId?: string; environmentId?: string; maxWidth: string; className?: string; } const ResponsiveButton: React.FC = ({ Icon, onClick, maxWidth, disabled = false, children, permission, environmentId, projectId, endIcon, ...rest }) => { const smallScreen = useMediaQuery(`(max-width:${maxWidth})`); return ( } elseShow={ {children} } /> ); }; export default ResponsiveButton;