mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 11:22:01 -05:00
12326b420d
GitOrigin-RevId: 51158acccc9967794b2192791961561d43274979
29 lines
578 B
TypeScript
29 lines
578 B
TypeScript
import classNames from 'classnames'
|
|
import React from 'react'
|
|
|
|
type IconProps = React.ComponentProps<'i'> & {
|
|
type: string
|
|
accessibilityLabel?: string
|
|
}
|
|
|
|
function MaterialIcon({
|
|
type,
|
|
className,
|
|
accessibilityLabel,
|
|
...rest
|
|
}: IconProps) {
|
|
const iconClassName = classNames('material-symbols', className)
|
|
|
|
return (
|
|
<>
|
|
<span className={iconClassName} aria-hidden="true" {...rest}>
|
|
{type}
|
|
</span>
|
|
{accessibilityLabel && (
|
|
<span className="sr-only">{accessibilityLabel}</span>
|
|
)}
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default MaterialIcon
|