@schemavaults/ui 0.54.2 → 0.54.3
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.
|
@@ -3,16 +3,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { RotateCcw } from "lucide-react";
|
|
4
4
|
import { Button } from "../../ui/button";
|
|
5
5
|
import { Wordmark } from "../../ui/wordmark";
|
|
6
|
+
import { cn } from "../../../lib/utils";
|
|
6
7
|
export function ErrorPage(props) {
|
|
7
8
|
if (!("error" in props)) {
|
|
8
9
|
throw new Error("ErrorPage did not receive an `error` prop");
|
|
9
10
|
}
|
|
10
11
|
const error = props.error;
|
|
11
12
|
let errorMsg;
|
|
12
|
-
if (typeof error === "number"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const message = props.message;
|
|
13
|
+
if (typeof error === "number" || typeof error === "string") {
|
|
14
|
+
const message = props
|
|
15
|
+
.message;
|
|
16
16
|
errorMsg = `${error}: ${message}`;
|
|
17
17
|
}
|
|
18
18
|
else if (error instanceof Error) {
|
|
@@ -23,7 +23,7 @@ export function ErrorPage(props) {
|
|
|
23
23
|
}
|
|
24
24
|
const resetButtonLabel = props.resetButtonLabel ?? "Try Again";
|
|
25
25
|
const additionalButtons = props.additionalButtons ?? [];
|
|
26
|
-
return (_jsxs("div", { className: "w-full grow flex flex-col justify-center items-center
|
|
26
|
+
return (_jsxs("div", { className: cn("w-full grow min-h-screen", "flex flex-col justify-center items-center", "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: cn("text-md", "mx-2 md:mx-4 lg:mx-8"), 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)))] }))] }));
|
|
27
27
|
}
|
|
28
28
|
export default ErrorPage;
|
|
29
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;AACpD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAmBjC,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,IAAI,CAAC,CAAC,OAAO,IAAI,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1B,IAAI,QAAgB,CAAC;IACrB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC3D,MAAM,OAAO,GAAY,KAA4C;aAClE,OAAO,CAAC;QACX,QAAQ,GAAG,GAAG,KAAK,KAAK,OAAO,EAAE,CAAC;IACpC,CAAC;SAAM,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAClC,QAAQ,G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