|
| 1 | +/* |
| 2 | + * CloudBeaver - Cloud Database Manager |
| 3 | + * Copyright (C) 2019-2024 DBeaver Corp |
| 4 | + * |
| 5 | + * All Rights Reserved |
| 6 | + * |
| 7 | + * NOTICE: All information contained herein is, and remains |
| 8 | + * the property of DBeaver Corp and its suppliers, if any. |
| 9 | + * The intellectual and technical concepts contained |
| 10 | + * herein are proprietary to DBeaver Corp and its suppliers |
| 11 | + * and may be covered by U.S. and Foreign Patents, |
| 12 | + * patents in process, and are protected by trade secret or copyright law. |
| 13 | + * Dissemination of this information or reproduction of this material |
| 14 | + * is strictly forbidden unless prior written permission is obtained |
| 15 | + * from DBeaver Corp. |
| 16 | + */ |
| 17 | +import { observer } from 'mobx-react-lite'; |
| 18 | + |
| 19 | +import { useTranslate } from './localization/useTranslate.js'; |
| 20 | +import { useS } from './useS.js'; |
| 21 | +import { s } from './s.js'; |
| 22 | +import { IconOrImage } from './IconOrImage.js'; |
| 23 | +import { Text } from './Text.js'; |
| 24 | +import classes from './Alert.module.css'; |
| 25 | + |
| 26 | +interface Props { |
| 27 | + message: string; |
| 28 | + title?: string; |
| 29 | +} |
| 30 | + |
| 31 | +export const Alert = observer<Props>(function Alert({ title, message }) { |
| 32 | + const translate = useTranslate(); |
| 33 | + const styles = useS(classes); |
| 34 | + |
| 35 | + return ( |
| 36 | + <div className={s(styles, { alert: true })} role="alert"> |
| 37 | + <IconOrImage icon="/icons/info_icon_sm.svg" /> |
| 38 | + <div className={s(styles, { body: true })}> |
| 39 | + <h3 className={s(styles, { title: true })}>{title ?? translate('ui_information')}</h3> |
| 40 | + <Text>{message}</Text> |
| 41 | + </div> |
| 42 | + </div> |
| 43 | + ); |
| 44 | +}); |
0 commit comments