xchain-components
Version:
Xchain Components
63 lines (56 loc) • 1.24 kB
JavaScript
/* @flow */
/* eslint react/jsx-filename-extension: 0 */
import * as React from 'react';
import { Message } from 'semantic-ui-react';
type Props = {
color: string,
compact: boolean,
content?: string,
error: boolean,
floating: boolean,
header: string,
hidden: boolean,
icon: string | boolean,
info: boolean,
negative: boolean,
onDismiss: (() => void) | boolean,
positive: boolean,
size: string,
success: boolean,
visible: boolean,
warning: boolean
};
const XMessage = (props: Props) => {
const {
color, compact, content, error, floating, header, hidden, icon, info, negative, onDismiss, positive, size, success, visible, warning
} = props;
return (
<Message
color={color}
compact={compact}
error={error}
floating={floating}
header={header}
hidden={hidden}
icon={icon}
info={info}
negative={negative}
onDismiss={onDismiss}
positive={positive}
size={size}
success={success}
visible={visible}
warning={warning}
content={content}
>
</Message>
);
};
XMessage.defaultProps = {
header: 'Message',
compact: false,
icon:false,
hidden:false,
visible: false
};
export default XMessage;