Files
flipper/desktop/plugins/public/ui-debugger/components/StreamInterceptorErrorView.tsx
Luke De Feo fd673d0535 Infrastructure for stream interceptor transform nodes
Summary:
Added stream interecptor which gets a chance to augment the messages off the wire. Stream interceptor transformations are async and can fail  due to network errors so added error state with a retry button. The retry button will just call the function again.

I am also handling errors better generally when this method fails unexpectedly, logging more clearly what went wrong and communicating it to the user

Did some refactoring of subtree update event to support this

Reviewed By: lblasa

Differential Revision: D44415260

fbshipit-source-id: a5a5542b318775b641d53941808399a8fa4634d3
2023-04-27 07:28:41 -07:00

37 lines
712 B
TypeScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import {Button, Result} from 'antd';
import * as React from 'react';
export function StreamInterceptorErrorView({
retryCallback,
title,
message,
}: {
title: string;
message: string;
retryCallback?: () => void;
}): React.ReactElement {
return (
<Result
status="error"
title={title}
subTitle={message}
extra={
retryCallback && (
<Button onClick={retryCallback} type="primary">
Retry
</Button>
)
}
/>
);
}