alerts: use shorthand return

This commit is contained in:
David Lechner
2022-11-22 15:56:56 -06:00
committed by David Lechner
parent 95199e44c1
commit 9fe62467d5
17 changed files with 109 additions and 140 deletions
+9 -8
View File
@@ -76,11 +76,12 @@ const UnexpectedErrorAlert: React.VoidFunctionComponent<UnexpectedErrorAlertProp
);
};
export const unexpectedError: CreateToast<{ error: Error }> = (onAction, { error }) => {
return {
message: <UnexpectedErrorAlert error={error} />,
icon: 'error',
intent: Intent.DANGER,
onDismiss: () => onAction('dismiss'),
};
};
export const unexpectedError: CreateToast<{ error: Error }> = (
onAction,
{ error },
) => ({
message: <UnexpectedErrorAlert error={error} />,
icon: 'error',
intent: Intent.DANGER,
onDismiss: () => onAction('dismiss'),
});