mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 17:38:10 +00:00
35 lines
695 B
TypeScript
35 lines
695 B
TypeScript
import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
|
|
import {
|
|
FontAwesomeIcon,
|
|
FontAwesomeIconProps
|
|
} from "@fortawesome/react-fontawesome";
|
|
|
|
|
|
export interface ButtonIconPropsI extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
icon: IconDefinition;
|
|
iconClass?: string;
|
|
iconProps?: FontAwesomeIconProps
|
|
}
|
|
|
|
export const ButtonIcon = ({
|
|
icon,
|
|
iconClass,
|
|
iconProps,
|
|
className : propsClassName,
|
|
...rest
|
|
}:ButtonIconPropsI)=>{
|
|
return(
|
|
<button
|
|
className={propsClassName}
|
|
{...rest}
|
|
>
|
|
{icon &&
|
|
<FontAwesomeIcon
|
|
{...iconProps}
|
|
className={iconClass}
|
|
icon={icon}
|
|
/>
|
|
}
|
|
</button>
|
|
);
|
|
} |