diff --git a/package.json b/package.json index 5aaddb8..dece881 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,6 @@ "react": "^18", "react-code-blocks": "^0.1.6", "react-dom": "^18", - "react-helmet": "^6.1.0", "react-icons": "^5.1.0", "react-simple-typewriter": "^5.0.1", "sharp": "^0.33.4", diff --git a/src/app/scripts/[id]/page.tsx b/src/app/scripts/[id]/page.tsx deleted file mode 100644 index d96189c..0000000 --- a/src/app/scripts/[id]/page.tsx +++ /dev/null @@ -1,115 +0,0 @@ -import Image from "next/image"; -import { extractDate } from "@/lib/time"; -import CloseButton from "@/components/closeButton"; -import { Separator } from "@/components/ui/separator"; -import DefaultSettings from "../_components/ScriptItems/DefaultSettings"; -import InterFaces from "../_components/ScriptItems/InterFaces"; -import Buttons from "../_components/ScriptItems/Buttons"; -import Description from "../_components/ScriptItems/Description"; -import Alerts from "../_components/ScriptItems/Alerts"; -import Tooltips from "../_components/ScriptItems/Tooltips"; -import InstallCommand from "../_components/ScriptItems/InstallCommand"; -import DefaultPassword from "../_components/ScriptItems/DefaultPassword"; -import type { Metadata, ResolvingMetadata } from "next"; - -type Props = { - params: { id: string }; - searchParams: { [key: string]: string | string[] | undefined }; -}; - -export async function generateMetadata({ params, searchParams }: Props, - parent: ResolvingMetadata -): Promise { - const id = params.id; - - const data = await fetch(`http://localhost:3000/api/scripts/script?title=${id}`).then((res) => res.json()); - const imgURL = `http://localhost:3000/api/og?title=${data.title}?logo=${data.logo}`; - - return { - title: `${data.title} | Proxmox VE Helper-Scripts`, - description: `This script will fully install and configure ${data.title} on your Proxmox VE host.`, - openGraph: { - title: `${data.title} | Proxmox VE Helper-Scripts`, - description: `This script will fully install and configure ${data.title} on your Proxmox VE host.`, - images: [ - { - url: imgURL, - width: 1200, - height: 630, - alt: data.title, - }, - ], - }, - }; -} - -export default async function Page({ params }: { params: { id: string } }) { - const data = await fetch( - `http://localhost:3000/api/scripts/script?title=${params.id}`, - ).then((res) => res.json()); - return ( -
- {data && ( -
-
-
-
-

Selected Script

- -
-
-
-
- {data.title} -
-
-
-

{data.title}

-

- Date added: {extractDate(data.created)} -

-
-
- -
-
-
-
-
- - -
-
- -
-
- - -
-
-
-

- How to {data.data_type ? "install" : "use"} -

- -
- - -
-
- -
-
-
-
- )} -
- ); -}