2023-06-26 10:07:12 +00:00
|
|
|
"use client";
|
|
|
|
|
|
2023-02-13 13:46:56 +00:00
|
|
|
import { FC } from "react";
|
|
|
|
|
import Iframe from "react-iframe";
|
|
|
|
|
import { Box } from "@mui/material";
|
|
|
|
|
|
|
|
|
|
interface OpenSearchWrapperProps {
|
|
|
|
|
url: string;
|
2025-11-21 14:55:28 +01:00
|
|
|
margin?: number;
|
2023-02-13 13:46:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const OpenSearchWrapper: FC<OpenSearchWrapperProps> = ({
|
|
|
|
|
url,
|
2025-11-21 14:55:28 +01:00
|
|
|
margin = 50,
|
2023-02-13 13:46:56 +00:00
|
|
|
}) => (
|
|
|
|
|
<Box sx={{ position: "relative", marginTop: "-100px" }}>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
width: "100%",
|
|
|
|
|
height: "100px",
|
|
|
|
|
marginTop: "-20px",
|
|
|
|
|
backgroundColor: "white",
|
|
|
|
|
zIndex: 100,
|
|
|
|
|
position: "relative",
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
2025-11-21 14:55:28 +01:00
|
|
|
marginTop: `-${margin}px`,
|
2023-02-13 13:46:56 +00:00
|
|
|
zIndex: 1,
|
|
|
|
|
position: "relative",
|
2025-11-21 14:55:28 +01:00
|
|
|
height: `calc(100vh + ${margin}px)`,
|
2023-02-13 13:46:56 +00:00
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Iframe
|
|
|
|
|
id="opensearch"
|
2025-11-21 14:55:28 +01:00
|
|
|
url={`/link/dashboards/${url}`}
|
2023-02-13 13:46:56 +00:00
|
|
|
width="100%"
|
|
|
|
|
height="100%"
|
|
|
|
|
frameBorder={0}
|
|
|
|
|
/>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
);
|