mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 00:41:31 +00:00
30 lines
934 B
TypeScript
30 lines
934 B
TypeScript
import React from "react";
|
|
import { Icon, Text } from "office-ui-fabric-react";
|
|
|
|
export interface PanelErrorProps {
|
|
message: string;
|
|
isWarning: boolean;
|
|
showErrorDetails: boolean;
|
|
openNotificationConsole?: () => void;
|
|
}
|
|
|
|
export const PanelErrorComponent: React.FunctionComponent<PanelErrorProps> = (props: PanelErrorProps): JSX.Element => (
|
|
<div className="panelWarningErrorContainer">
|
|
{props.isWarning ? (
|
|
<Icon iconName="WarningSolid" className="panelWarningIcon" />
|
|
) : (
|
|
<Icon iconName="StatusErrorFull" className="panelErrorIcon" />
|
|
)}
|
|
<span className="panelWarningErrorDetailsLinkContainer">
|
|
<Text className="panelWarningErrorMessage" variant="small">
|
|
{props.message}
|
|
</Text>
|
|
{props.showErrorDetails && (
|
|
<a className="paneErrorLink" role="link" onClick={props.openNotificationConsole}>
|
|
More details
|
|
</a>
|
|
)}
|
|
</span>
|
|
</div>
|
|
);
|