This commit is contained in:
Darren Clarke 2023-08-25 07:11:33 +00:00
parent 8f165d15d2
commit c620e4bf25
264 changed files with 9983 additions and 2280 deletions

View file

@ -1,32 +0,0 @@
"use client";
import { FC } from "react";
import { Grid } from "@mui/material";
import Iframe from "react-iframe";
type LeafcutterWrapperProps = {
path: string;
};
export const LeafcutterWrapper: FC<LeafcutterWrapperProps> = ({ path }) => {
const leafcutterURL = `https://lc.digiresilience.org/${path}`;
return (
<Grid
container
spacing={0}
sx={{ height: "100%", width: "100%" }}
direction="column"
>
<Grid item sx={{ height: "100vh", width: "100%" }}>
<Iframe
id="leafcutter"
url={leafcutterURL}
width="100%"
height="100%"
frameBorder={0}
/>
</Grid>
</Grid>
);
};

View file

@ -1,11 +0,0 @@
import { LeafcutterWrapper } from "./_components/LeafcutterWrapper";
type PageProps = {
params: {
view: string;
};
};
export default function Page({ params: { view } }: PageProps) {
return <LeafcutterWrapper path={view} />;
}

View file

@ -0,0 +1,30 @@
"use client";
import { FC, useEffect, useState } from "react";
import { Home as HomeInternal } from "leafcutter-common";
import { fetchLeafcutter } from "@/app/_lib/utils";
import ClientOnly from "@/app/(main)/_components/ClientOnly";
export const Home: FC = () => {
const [visualizations, setVisualizations] = useState([]);
useEffect(() => {
const getVisualizations = async () => {
const visualizations = await fetchLeafcutter(
"https://macmini.tiger-agama.ts.net:3001/api/visualizations/list",
{},
);
if (visualizations) {
setVisualizations(visualizations);
}
};
getVisualizations();
}, []);
return (
<ClientOnly>
<HomeInternal visualizations={visualizations} />
</ClientOnly>
);
};

View file

@ -0,0 +1,6 @@
import { FC, PropsWithChildren } from "react";
import { Box } from "@mui/material";
export const LeafcutterWrapper: FC<PropsWithChildren> = ({ children }) => {
return <Box sx={{ p: 3 }}>{children}</Box>;
};

View file

@ -0,0 +1,10 @@
import { Box } from "@mui/material";
import { About } from "leafcutter-common";
export default function Page() {
return (
<Box sx={{ p: 3 }}>
<About />
</Box>
);
}

View file

@ -0,0 +1,13 @@
// import { getTemplates } from "app/_lib/opensearch";
import { Create } from "leafcutter-common";
import { Box } from "@mui/material";
export default async function Page() {
const templates = []; // await getTemplates(100);
return (
<Box sx={{ p: 3 }}>
<Create templates={templates} />
</Box>
);
}

View file

@ -0,0 +1,10 @@
import { Box } from "@mui/material";
import { FAQ } from "leafcutter-common";
export default function Page() {
return (
<Box sx={{ p: 3 }}>
<FAQ />
</Box>
);
}

View file

@ -0,0 +1,10 @@
import { Box } from "@mui/material";
import { FAQ } from "leafcutter-common";
export default function Page() {
return (
<Box sx={{ p: 3 }}>
<FAQ />
</Box>
);
}

View file

@ -1,5 +1,10 @@
import { redirect } from "next/navigation";
import { Home } from "./_components/Home";
import { LeafcutterWrapper } from "./_components/LeafcutterWrapper";
export default function Page() {
redirect("/leafcutter/home");
export default async function Page() {
return (
<LeafcutterWrapper>
<Home />
</LeafcutterWrapper>
);
}

View file

@ -0,0 +1,12 @@
import { Box } from "@mui/material";
import { Trends } from "leafcutter-common";
export default function Page() {
return (
<Box sx={{ p: 3 }}>
<Trends visualizations={[]} />
</Box>
);
}
export const dynamic = "force-dynamic";