The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/components/basic/Icon.js

22 lines
559 B

import React from 'react';
const SvgIcon = ({ icon, block = '', baseUrl = '', className }) => <svg
className={[
'rc-icon',
block,
block && icon && `${ block }--${ icon }`,
className,
].filter(Boolean).join(' ')}
aria-hidden='true'
>
<use xlinkHref={`${ baseUrl }#icon-${ icon }`} />
</svg>;
const FontIcon = ({ icon, className }) => <i
className={[icon, className].filter(Boolean).join(' ')}
/>;
export const Icon = ({ icon, ...props }) =>
(/^icon-/.test(icon)
? <FontIcon icon={icon} {...props} />
: <SvgIcon icon={icon} {...props} />);