mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 16:33:15 +01:00
23 lines
No EOL
501 B
TypeScript
23 lines
No EOL
501 B
TypeScript
import React from 'react';
|
|
import cx from 'classnames';
|
|
|
|
export default function Fa({icon, fw, fa, stack, className, ...props}: {
|
|
icon: string,
|
|
fw?: boolean,
|
|
fa?: string[],
|
|
stack?: string,
|
|
className?: string,
|
|
props?: any
|
|
}) {
|
|
const faCss = fa ? fa.map(s => 'fa-' + s) : [];
|
|
if (icon) {
|
|
icon = 'fa-' + icon;
|
|
}
|
|
if (fw) {
|
|
faCss.push('fa-fw');
|
|
}
|
|
if (stack) {
|
|
faCss.push('fa-stack-' + stack);
|
|
}
|
|
return <i className={ cx('fa', icon, faCss, className) } {...props}/>
|
|
} |