2023-02-14 05:21:09 -05:00
|
|
|
import classNames from 'classnames'
|
2023-08-25 04:51:45 -04:00
|
|
|
import React from 'react'
|
2023-02-14 05:21:09 -05:00
|
|
|
|
2024-02-15 04:43:16 -05:00
|
|
|
type IconProps = React.ComponentProps<'i'> & {
|
2023-02-14 05:21:09 -05:00
|
|
|
type: string
|
|
|
|
accessibilityLabel?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
function MaterialIcon({
|
|
|
|
type,
|
|
|
|
className,
|
|
|
|
accessibilityLabel,
|
|
|
|
...rest
|
|
|
|
}: IconProps) {
|
2024-02-15 04:43:16 -05:00
|
|
|
const iconClassName = classNames('material-symbols', className)
|
2023-02-14 05:21:09 -05:00
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<span className={iconClassName} aria-hidden="true" {...rest}>
|
|
|
|
{type}
|
|
|
|
</span>
|
|
|
|
{accessibilityLabel && (
|
|
|
|
<span className="sr-only">{accessibilityLabel}</span>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default MaterialIcon
|