@deix/rossini-core 2.1.7 → 2.1.8
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.
|
@@ -20,10 +20,6 @@ export interface FooterProps {
|
|
|
20
20
|
* The UI info (name and version)
|
|
21
21
|
*/
|
|
22
22
|
uiInfo?: ApplicationInfo;
|
|
23
|
-
/**
|
|
24
|
-
* The URL for the backend API. This will send a request to /info for the name and version of the API and show this information. If this is not provided or if the fetch fails nothing is shown in the footer.
|
|
25
|
-
*/
|
|
26
|
-
apiURL?: string;
|
|
27
23
|
/**
|
|
28
24
|
* A React component to be shown underneath the main footer.
|
|
29
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/Footer/Footer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/components/Footer/Footer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKzC,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAgEjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,25 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Box, Typography, useTheme } from '@mui/material';
|
|
4
|
-
import { useQuery } from '@tanstack/react-query';
|
|
5
|
-
import { useOptionalAPI } from '../../../../utils/index';
|
|
6
4
|
import DeixLogo from '../../assets/DeixLogo';
|
|
7
|
-
const Footer = ({ logo = React.createElement(DeixLogo, null), text = 'Deix Srl', textURL = 'https://
|
|
5
|
+
const Footer = ({ logo = React.createElement(DeixLogo, null), text = 'Deix Srl', textURL = 'https://deix.ai', uiInfo = { name: '', version: '' }, children, }) => {
|
|
8
6
|
const muiTheme = useTheme();
|
|
9
|
-
// Get App Info (name and version)
|
|
10
|
-
// Get API info (name and version) from backend
|
|
11
|
-
const apiClient = useOptionalAPI(apiURL);
|
|
12
|
-
const getAPIInfo = async () => {
|
|
13
|
-
if (apiClient) {
|
|
14
|
-
const { data } = await apiClient.get('info');
|
|
15
|
-
return data;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const { data: apiInfo } = useQuery({
|
|
19
|
-
queryKey: ['api-info'],
|
|
20
|
-
queryFn: getAPIInfo,
|
|
21
|
-
staleTime: Infinity,
|
|
22
|
-
});
|
|
23
7
|
return (React.createElement("footer", { style: { marginTop: 'auto' } },
|
|
24
8
|
React.createElement(Box, { sx: {
|
|
25
9
|
display: 'flex',
|
|
@@ -47,13 +31,11 @@ const Footer = ({ logo = React.createElement(DeixLogo, null), text = 'Deix Srl',
|
|
|
47
31
|
textDecoration: 'none',
|
|
48
32
|
color: muiTheme.palette.text.secondary,
|
|
49
33
|
} }, text),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
' ',
|
|
56
|
-
apiInfo ? `(${apiInfo.name} ${apiInfo.version})` : '')),
|
|
34
|
+
uiInfo && uiInfo.name && (React.createElement("span", null,
|
|
35
|
+
' | ',
|
|
36
|
+
uiInfo.name,
|
|
37
|
+
" ",
|
|
38
|
+
uiInfo.version)))),
|
|
57
39
|
children))));
|
|
58
40
|
};
|
|
59
41
|
export default Footer;
|