2023-06-26 10:07:12 +00:00
|
|
|
"use client";
|
|
|
|
|
|
2023-03-15 12:16:54 +00:00
|
|
|
import { FC } from "react";
|
2023-06-26 10:07:12 +00:00
|
|
|
import getConfig from "next/config";
|
2022-12-02 17:45:14 +01:00
|
|
|
import { Grid } from "@mui/material";
|
2022-12-14 13:24:50 +01:00
|
|
|
import Iframe from "react-iframe";
|
2022-12-02 17:45:14 +01:00
|
|
|
|
2023-06-26 10:07:12 +00:00
|
|
|
type LeafcutterWrapperProps = {
|
|
|
|
|
path: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const LeafcutterWrapper: FC<LeafcutterWrapperProps> = ({ path }) => {
|
|
|
|
|
const {
|
|
|
|
|
publicRuntimeConfig: { linkURL },
|
|
|
|
|
} = getConfig();
|
|
|
|
|
const fullLeafcutterURL = `${linkURL}/proxy/leafcutter/${path}`;
|
|
|
|
|
|
|
|
|
|
return (
|
2022-12-02 17:45:14 +01:00
|
|
|
<Grid
|
|
|
|
|
container
|
|
|
|
|
spacing={0}
|
|
|
|
|
sx={{ height: "100%", width: "100%" }}
|
|
|
|
|
direction="column"
|
|
|
|
|
>
|
2022-12-14 13:24:50 +01:00
|
|
|
<Grid item sx={{ height: "100vh", width: "100%" }}>
|
|
|
|
|
<Iframe
|
2023-06-26 10:07:12 +00:00
|
|
|
id="leafcutter"
|
|
|
|
|
url={fullLeafcutterURL}
|
2022-12-14 13:24:50 +01:00
|
|
|
width="100%"
|
|
|
|
|
height="100%"
|
|
|
|
|
frameBorder={0}
|
2022-12-02 17:45:14 +01:00
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
2023-06-26 10:07:12 +00:00
|
|
|
);
|
|
|
|
|
};
|