PromucFlow_constructor/app/client/src/editorComponents/IconComponent.tsx

28 lines
693 B
TypeScript
Raw Normal View History

2019-03-21 12:10:32 +00:00
import * as React from "react"
2019-09-05 17:47:50 +00:00
import { ComponentProps } from "./BaseComponent"
2019-03-21 12:10:32 +00:00
import { Icon, Intent } from "@blueprintjs/core"
import { IconName } from "@blueprintjs/icons"
import { Container } from "./ContainerComponent"
2019-08-29 11:22:09 +00:00
class IconComponent extends React.Component<IconComponentProps> {
render() {
return (
2019-03-21 12:10:32 +00:00
<Container {...this.props}>
2019-03-16 11:38:22 +00:00
<Icon
icon={this.props.icon}
iconSize={this.props.iconSize}
intent={this.props.intent}
/>
2019-03-21 12:10:32 +00:00
</Container>
)
}
}
2019-09-05 17:47:50 +00:00
export interface IconComponentProps extends ComponentProps {
2019-08-29 11:22:09 +00:00
iconSize?: number;
icon?: IconName;
intent?: Intent;
ellipsize?: boolean;
}
2019-03-21 12:10:32 +00:00
export default IconComponent