mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 18:46:17 +00:00
alerts: use shorthand return
This commit is contained in:
committed by
David Lechner
parent
95199e44c1
commit
9fe62467d5
@@ -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'),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user