openreplay/frontend/app/components/ui/Message/Message.js
Андрей Бабушкин 2b1a9f3378 add locales and lint the project
2025-03-05 16:09:18 +01:00

35 lines
727 B
JavaScript

import React from 'react';
import { Icon } from 'UI';
import cn from 'classnames';
import styles from './message.module.css';
// TODO this has to be improved
function Message({
icon = 'check',
hidden = false,
visible = false,
children,
inline = false,
success = false,
info = true,
text = undefined,
}) {
return visible || !hidden ? (
<div
className={cn(styles.message, 'flex items-center')}
data-inline={inline}
>
<Icon
name={success ? 'check' : 'close'}
color={success ? 'green' : 'red'}
className="mr-2"
size={success ? 20 : 14}
/>
{text || children}
</div>
) : null;
}
Message.displayName = 'Message';
export default Message;