mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 06:25:28 -05:00
5b0c122f5d
List of user emails GitOrigin-RevId: 28a8e405812932ba7ebd8043a4dc9d3c573a68b2
41 lines
669 B
TypeScript
41 lines
669 B
TypeScript
import classNames from 'classnames'
|
|
|
|
type IconProps = {
|
|
type: string
|
|
spin?: boolean
|
|
fw?: boolean
|
|
modifier?: string
|
|
className?: string
|
|
accessibilityLabel?: string
|
|
}
|
|
|
|
function Icon({
|
|
type,
|
|
spin,
|
|
fw,
|
|
modifier,
|
|
className = '',
|
|
accessibilityLabel,
|
|
}: IconProps) {
|
|
const iconClassName = classNames(
|
|
'fa',
|
|
`fa-${type}`,
|
|
{
|
|
'fa-spin': spin,
|
|
'fa-fw': fw,
|
|
[`fa-${modifier}`]: modifier,
|
|
},
|
|
className
|
|
)
|
|
|
|
return (
|
|
<>
|
|
<i className={iconClassName} aria-hidden="true" />
|
|
{accessibilityLabel && (
|
|
<span className="sr-only">{accessibilityLabel}</span>
|
|
)}
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default Icon
|