mirror of
https://github.com/fleetdm/fleet
synced 2026-05-01 18:37:37 +00:00
relates to #11932 This improves the UI error messaging for AMB 400 errors  - [x] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [x] Manual QA for all new/changed functionality - For Orbit and Fleet Desktop changes: - [ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux. - [ ] Auto-update manual QA, from released version of component to new version (see [tools/tuf/test](../tools/tuf/test/README.md)).
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
import React from "react";
|
|
import classnames from "classnames";
|
|
|
|
import CustomLink from "components/CustomLink";
|
|
import Icon from "components/Icon";
|
|
|
|
const baseClass = "data-error";
|
|
|
|
interface IDataErrorProps {
|
|
children?: React.ReactNode;
|
|
card?: boolean;
|
|
className?: string;
|
|
}
|
|
|
|
const DataError = ({
|
|
children,
|
|
card,
|
|
className,
|
|
}: IDataErrorProps): JSX.Element => {
|
|
const classes = classnames(baseClass, className);
|
|
|
|
return (
|
|
<div className={classes}>
|
|
<div className={`${baseClass}__${card ? "card" : "inner"}`}>
|
|
<div className="info">
|
|
<span className="info__header">
|
|
<Icon name="alert" />
|
|
Something's gone wrong.
|
|
</span>
|
|
|
|
<>
|
|
{children || (
|
|
<>
|
|
<span className="info__data">
|
|
Refresh the page or log in again.
|
|
</span>
|
|
<span className="info__data">
|
|
If this keeps happening, please
|
|
<CustomLink
|
|
url="https://github.com/fleetdm/fleet/issues/new/choose"
|
|
text="file an issue"
|
|
newTab
|
|
/>
|
|
</span>
|
|
</>
|
|
)}
|
|
</>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default DataError;
|