mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 03:53:05 -05:00
c3ed95bc48
[web] BS5 projects table migration GitOrigin-RevId: 237bd8113c68d7fd1b66712f7361eb956b1e10e7
32 lines
701 B
TypeScript
32 lines
701 B
TypeScript
import classNames from 'classnames'
|
|
import React from 'react'
|
|
import { bsVersion } from '@/features/utils/bootstrap-5'
|
|
|
|
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={bsVersion({ bs5: 'visually-hidden', bs3: 'sr-only' })}>
|
|
{accessibilityLabel}
|
|
</span>
|
|
)}
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default MaterialIcon
|