mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 04:38:50 -05:00
fa3f51fb2e
[web] - Updating the Account Settings page with the Button and Icon Button wrappers GitOrigin-RevId: 135c4ddaa64d009d3ab8cdfef9cff899fd77669c
28 lines
842 B
TypeScript
28 lines
842 B
TypeScript
import classNames from 'classnames'
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
import Button from './button'
|
|
import type { IconButtonProps } from '@/features/ui/components/types/icon-button-props'
|
|
|
|
export default function IconButton({
|
|
accessibilityLabel,
|
|
icon,
|
|
isLoading = false,
|
|
size = 'default',
|
|
...props
|
|
}: IconButtonProps) {
|
|
const iconButtonClassName = `icon-button-${size}`
|
|
const iconSizeClassName = size === 'large' ? 'icon-large' : 'icon-small'
|
|
const materialIconClassName = classNames(iconSizeClassName, {
|
|
'button-content-hidden': isLoading,
|
|
})
|
|
|
|
return (
|
|
<Button className={iconButtonClassName} isLoading={isLoading} {...props}>
|
|
<MaterialIcon
|
|
accessibilityLabel={accessibilityLabel}
|
|
className={materialIconClassName}
|
|
type={icon}
|
|
/>
|
|
</Button>
|
|
)
|
|
}
|