From 8d35e7ab0ff62eb4b2948993817b564e86afbe4a Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 21 Apr 2024 17:39:56 +0100 Subject: [PATCH] cleanup imports --- src/app/(pages)/docs/[[...slug]]/page.tsx | 13 ++++++------- src/app/(pages)/docs/layout.tsx | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/app/(pages)/docs/[[...slug]]/page.tsx b/src/app/(pages)/docs/[[...slug]]/page.tsx index 21e6bf8..d471d52 100644 --- a/src/app/(pages)/docs/[[...slug]]/page.tsx +++ b/src/app/(pages)/docs/[[...slug]]/page.tsx @@ -2,7 +2,7 @@ import { CustomMDX } from "@/app/components/mdx-components"; import { Metadata } from "next"; import { generateEmbed } from "@/app/common/embed"; import { Title } from "@/app/components/title"; -import { getDocContent, getDocsContent } from "@/app/common/documentation"; +import { DocsContentMetadata, getDocContent, getDocsContent } from "@/app/common/documentation"; import { Breadcrumb, BreadcrumbItem, @@ -13,7 +13,6 @@ import { import { capitalizeFirstLetter } from "@/app/common/string-utils"; import { notFound } from "next/navigation"; import { GithubLink } from "@/app/components/docs/github-link"; -import { cn } from "@/app/common/utils"; type DocumentationPageParams = { params: { @@ -25,7 +24,7 @@ type DocumentationPageParams = { }; export async function generateStaticParams() { - let documentationPages = getDocsContent(); + let documentationPages: DocsContentMetadata[] = getDocsContent(); return documentationPages.map(page => ({ slug: [page.slug], @@ -33,7 +32,7 @@ export async function generateStaticParams() { } export async function generateMetadata({ params: { slug } }: DocumentationPageParams): Promise { - const page = getDocContent(slug); + const page: DocsContentMetadata | undefined = getDocContent(slug); // Fallback to page not found if (!page) { @@ -50,15 +49,15 @@ export async function generateMetadata({ params: { slug } }: DocumentationPagePa } export default function Page({ params: { slug } }: DocumentationPageParams) { - const page = getDocContent(slug); + const page: DocsContentMetadata | undefined = getDocContent(slug); // Page was not found, show an error page if (!page) { return notFound(); } - const slugParts = page.slug.split("/"); - const isHome = slugParts.length == 1; + const slugParts: string[] = page.slug.split("/"); + const isHome: boolean = slugParts.length == 1; return (
diff --git a/src/app/(pages)/docs/layout.tsx b/src/app/(pages)/docs/layout.tsx index 90653f7..339cdb0 100644 --- a/src/app/(pages)/docs/layout.tsx +++ b/src/app/(pages)/docs/layout.tsx @@ -1,5 +1,4 @@ import React, { ReactElement } from "react"; -import { Search } from "@/app/components/docs/search"; import { Sidebar } from "@/app/components/docs/sidebar"; export default function RootLayout({