@cgi-learning-hub/ui 0.0.1-dev.1718895916 → 0.0.1-dev.1718897603

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 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),t=require("./helpers.cjs.js"),s=require("../../../Typography-6WB4M4zs.cjs"),i=({error:r})=>{if(t.isFetchBaseQueryError(r)){const n="error"in r?r.error:r.data?JSON.stringify(r.data):null;return e.jsxs(s.Typography,{children:[e.jsx(s.Typography,{fontWeight:"bold",children:`Erreur ${r.status}`}),n]})}return t.isErrorWithMessage(r)?e.jsx(s.Typography,{children:r.message}):e.jsx(s.Typography,{children:"Une erreur est survenue."})};module.exports=i;
1
+ "use strict";const e=require("react/jsx-runtime"),t=require("./helpers.cjs.js"),s=require("../../../Typography-6WB4M4zs.cjs"),u=({error:r,statusPrefix:n="Erreur "})=>{if(t.isFetchBaseQueryError(r)){const i="error"in r?r.error:r.data?JSON.stringify(r.data):null;return e.jsxs(s.Typography,{children:[e.jsx(s.Typography,{fontWeight:"bold",children:`${n}${r.status}`}),i]})}return t.isErrorWithMessage(r)?e.jsx(s.Typography,{children:r.message}):e.jsx(s.Typography,{children:"Une erreur est survenue."})};module.exports=u;
@@ -3,6 +3,7 @@ import { FetchBaseQueryError } from '@reduxjs/toolkit/query';
3
3
 
4
4
  export interface QueryErrorProps {
5
5
  error: FetchBaseQueryError | SerializedError | undefined;
6
+ statusPrefix?: string;
6
7
  }
7
8
  declare const QueryError: React.FunctionComponent<QueryErrorProps>;
8
9
  export default QueryError;
@@ -1,18 +1,19 @@
1
- import { jsxs as i, jsx as s } from "react/jsx-runtime";
2
- import { isFetchBaseQueryError as n, isErrorWithMessage as a } from "./helpers.es.js";
1
+ import { jsxs as n, jsx as s } from "react/jsx-runtime";
2
+ import { isFetchBaseQueryError as a, isErrorWithMessage as u } from "./helpers.es.js";
3
3
  import { T as e } from "../../../Typography-D9Jbc-Y5.js";
4
- const f = ({
5
- error: r
4
+ const h = ({
5
+ error: r,
6
+ statusPrefix: t = "Erreur "
6
7
  }) => {
7
- if (n(r)) {
8
- const t = "error" in r ? r.error : r.data ? JSON.stringify(r.data) : null;
9
- return /* @__PURE__ */ i(e, { children: [
10
- /* @__PURE__ */ s(e, { fontWeight: "bold", children: `Erreur ${r.status}` }),
11
- t
8
+ if (a(r)) {
9
+ const i = "error" in r ? r.error : r.data ? JSON.stringify(r.data) : null;
10
+ return /* @__PURE__ */ n(e, { children: [
11
+ /* @__PURE__ */ s(e, { fontWeight: "bold", children: `${t}${r.status}` }),
12
+ i
12
13
  ] });
13
14
  }
14
- return a(r) ? /* @__PURE__ */ s(e, { children: r.message }) : /* @__PURE__ */ s(e, { children: "Une erreur est survenue." });
15
+ return u(r) ? /* @__PURE__ */ s(e, { children: r.message }) : /* @__PURE__ */ s(e, { children: "Une erreur est survenue." });
15
16
  };
16
17
  export {
17
- f as default
18
+ h as default
18
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgi-learning-hub/ui",
3
- "version": "0.0.1-dev.1718895916",
3
+ "version": "0.0.1-dev.1718897603",
4
4
  "private": false,
5
5
  "author": "CGI Learning-hub Team",
6
6
  "description": "@cgi-learning-hub/ui is an open-source React component library that implements UI for HUB's features",