cleanup imports

This commit is contained in:
Lee 2024-04-21 17:39:56 +01:00
parent ec27cd9f29
commit 8d35e7ab0f
2 changed files with 6 additions and 8 deletions

@ -2,7 +2,7 @@ import { CustomMDX } from "@/app/components/mdx-components";
import { Metadata } from "next"; import { Metadata } from "next";
import { generateEmbed } from "@/app/common/embed"; import { generateEmbed } from "@/app/common/embed";
import { Title } from "@/app/components/title"; import { Title } from "@/app/components/title";
import { getDocContent, getDocsContent } from "@/app/common/documentation"; import { DocsContentMetadata, getDocContent, getDocsContent } from "@/app/common/documentation";
import { import {
Breadcrumb, Breadcrumb,
BreadcrumbItem, BreadcrumbItem,
@ -13,7 +13,6 @@ import {
import { capitalizeFirstLetter } from "@/app/common/string-utils"; import { capitalizeFirstLetter } from "@/app/common/string-utils";
import { notFound } from "next/navigation"; import { notFound } from "next/navigation";
import { GithubLink } from "@/app/components/docs/github-link"; import { GithubLink } from "@/app/components/docs/github-link";
import { cn } from "@/app/common/utils";
type DocumentationPageParams = { type DocumentationPageParams = {
params: { params: {
@ -25,7 +24,7 @@ type DocumentationPageParams = {
}; };
export async function generateStaticParams() { export async function generateStaticParams() {
let documentationPages = getDocsContent(); let documentationPages: DocsContentMetadata[] = getDocsContent();
return documentationPages.map(page => ({ return documentationPages.map(page => ({
slug: [page.slug], slug: [page.slug],
@ -33,7 +32,7 @@ export async function generateStaticParams() {
} }
export async function generateMetadata({ params: { slug } }: DocumentationPageParams): Promise<Metadata> { export async function generateMetadata({ params: { slug } }: DocumentationPageParams): Promise<Metadata> {
const page = getDocContent(slug); const page: DocsContentMetadata | undefined = getDocContent(slug);
// Fallback to page not found // Fallback to page not found
if (!page) { if (!page) {
@ -50,15 +49,15 @@ export async function generateMetadata({ params: { slug } }: DocumentationPagePa
} }
export default function Page({ params: { slug } }: DocumentationPageParams) { 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 // Page was not found, show an error page
if (!page) { if (!page) {
return notFound(); return notFound();
} }
const slugParts = page.slug.split("/"); const slugParts: string[] = page.slug.split("/");
const isHome = slugParts.length == 1; const isHome: boolean = slugParts.length == 1;
return ( return (
<div className="w-full h-full px-4 flex flex-col gap-4"> <div className="w-full h-full px-4 flex flex-col gap-4">

@ -1,5 +1,4 @@
import React, { ReactElement } from "react"; import React, { ReactElement } from "react";
import { Search } from "@/app/components/docs/search";
import { Sidebar } from "@/app/components/docs/sidebar"; import { Sidebar } from "@/app/components/docs/sidebar";
export default function RootLayout({ export default function RootLayout({