@schemavaults/ui 0.53.1 → 0.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import type { ReactElement } from "react";
|
|
2
|
-
|
|
3
|
-
error: Error;
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
type ErrorPageCommonProps = {
|
|
4
3
|
reset?: () => void;
|
|
4
|
+
resetButtonLabel?: string;
|
|
5
|
+
additionalButtons?: ReactNode[];
|
|
6
|
+
};
|
|
7
|
+
export type ErrorPageProps = ({
|
|
8
|
+
error: Error;
|
|
5
9
|
} | {
|
|
6
10
|
error: number | string;
|
|
7
11
|
message: string;
|
|
8
|
-
|
|
9
|
-
};
|
|
12
|
+
}) & ErrorPageCommonProps;
|
|
10
13
|
export declare function ErrorPage(props: ErrorPageProps): ReactElement;
|
|
11
14
|
export default ErrorPage;
|
|
@@ -21,7 +21,9 @@ export function ErrorPage(props) {
|
|
|
21
21
|
else {
|
|
22
22
|
errorMsg = "An unknown error occurred!";
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
const resetButtonLabel = props.resetButtonLabel ?? "Try Again";
|
|
25
|
+
const additionalButtons = props.additionalButtons ?? [];
|
|
26
|
+
return (_jsxs("div", { className: "w-full grow flex flex-col justify-center items-center min-h-screen p-2 md:p-4 lg:p-8", children: [_jsxs("h1", { className: "text-xl flex flex-row gap-4", children: [_jsx(Wordmark, {}), " Error"] }), _jsx("p", { className: "text-md", children: errorMsg }), (props.reset || additionalButtons.length > 0) && (_jsxs("div", { className: "mt-4 flex flex-row gap-2", children: [props.reset && (_jsxs(Button, { onClick: props.reset, className: "flex flex-row gap-2", children: [_jsx(RotateCcw, { size: 16 }), " ", resetButtonLabel] })), additionalButtons.map((button, index) => (_jsx("div", { children: button }, index)))] }))] }));
|
|
25
27
|
}
|
|
26
28
|
export default ErrorPage;
|
|
27
29
|
//# sourceMappingURL=ErrorPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorPage.js","sourceRoot":"","sources":["../../../../src/components/error/ErrorPage/ErrorPage.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ErrorPage.js","sourceRoot":"","sources":["../../../../src/components/error/ErrorPage/ErrorPage.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAepD,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,IAAI,CAAC,CAAC,OAAO,IAAI,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAA;IAC9D,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1B,IAAI,QAAgB,CAAC;IACrB,IACE,OAAO,KAAK,KAAK,QAAQ;;YAEzB,OAAO,KAAK,KAAK,QAAQ,EACzB,CAAC;QACD,MAAM,OAAO,GAAY,KAA4C,CAAC,OAAO,CAAC;QAC9E,QAAQ,GAAG,GAAG,KAAK,KAAK,OAAO,EAAE,CAAC;IACpC,CAAC;SAAM,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAClC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;IAC3B,CAAC;SAAM,CAAC;QACN,QAAQ,GAAG,4BAAqC,CAAC;IACnD,CAAC;IACD,MAAM,gBAAgB,GAAW,KAAK,CAAC,gBAAgB,IAAI,WAAW,CAAC;IACvE,M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