mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
Cb 3675 projects notifications (#1818)
* CB-3675 add project notifications * CB-3675 revert status message logic --------- Co-authored-by: dariamarutkina <125263541+dariamarutkina@users.noreply.github.com>
This commit is contained in:
@@ -43,13 +43,14 @@ interface Props {
|
||||
message?: string | string[] | null;
|
||||
status?: ENotificationType;
|
||||
exception?: Error | null;
|
||||
onShowDetails?: () => void;
|
||||
className?: string;
|
||||
onShowDetails?: () => void;
|
||||
}
|
||||
|
||||
export const StatusMessage = observer<Props>(function StatusMessage({ status, message, exception = null, onShowDetails, className }) {
|
||||
export const StatusMessage = observer<Props>(function StatusMessage({ status, message, exception = null, className, onShowDetails }) {
|
||||
const translate = useTranslate();
|
||||
const errorDetails = useErrorDetails(exception);
|
||||
const isError = status === ENotificationType.Error || exception !== null;
|
||||
|
||||
if (Array.isArray(message)) {
|
||||
message = message.map(m => translate(m)).join(', ');
|
||||
@@ -60,7 +61,7 @@ export const StatusMessage = observer<Props>(function StatusMessage({ status, me
|
||||
message = message ?? errorDetails.message;
|
||||
let icon = '/icons/info_icon.svg';
|
||||
|
||||
if (status === ENotificationType.Error || exception !== null) {
|
||||
if (isError) {
|
||||
icon = '/icons/error_icon.svg';
|
||||
} else if (status === ENotificationType.Success) {
|
||||
icon = '/icons/success_icon.svg';
|
||||
|
||||
Reference in New Issue
Block a user