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.
 
 
 
 
 

22 lines
692 B

import React, {CSSProperties, PropsWithChildren, useMemo} from "react";
import {IconProp} from "@fortawesome/fontawesome-svg-core";
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
export type WithChildren = PropsWithChildren<Record<never, never>>;
export type WithStyle = { style?: CSSProperties }
interface IconProps {
value: IconProp
spin?: boolean
flash?: boolean
subtle?: boolean
}
export function Icon({value, spin, flash, subtle}: IconProps) {
const style: CSSProperties = useMemo(() => {
return subtle ? {opacity: 0.5} : {};
}, [subtle]);
return <FontAwesomeIcon style={style} icon={value} spin={spin} beatFade={flash}/>;
}