overleaf/services/web/frontend/js/shared/components/material-icon.tsx
Davinder Singh ba2d5db50c Merge pull request #11670 from overleaf/ab-manage-members-back-button
[web] Add a back button on the members/managers management pages

GitOrigin-RevId: 7a723853683438ebac91eb534f9fb9a445a306c9
2023-02-15 09:04:46 +00:00

31 lines
622 B
TypeScript

import classNames from 'classnames'
type IconOwnProps = {
type: string
accessibilityLabel?: string
}
type IconProps = IconOwnProps &
Omit<React.ComponentProps<'i'>, keyof IconOwnProps>
function MaterialIcon({
type,
className,
accessibilityLabel,
...rest
}: IconProps) {
const iconClassName = classNames('material-symbols-rounded', className)
return (
<>
<span className={iconClassName} aria-hidden="true" {...rest}>
{type}
</span>
{accessibilityLabel && (
<span className="sr-only">{accessibilityLabel}</span>
)}
</>
)
}
export default MaterialIcon