docs: fix types

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-12-15 10:50:34 +01:00
parent 1f5c648afe
commit 95846f80e5
4 changed files with 10 additions and 7 deletions

View File

@@ -216,3 +216,4 @@ tracker = OpenPanel::SDK::Tracker.new(
)
```

View File

@@ -12,7 +12,11 @@ import {
import type { Metadata } from 'next';
import { notFound } from 'next/navigation';
export default async function Page(props: PageProps<'/docs/[[...slug]]'>) {
type PageProps = {
params: Promise<{ slug: string[] }>;
};
export default async function Page(props: PageProps) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();
@@ -39,9 +43,7 @@ export async function generateStaticParams() {
return source.generateParams();
}
export async function generateMetadata(
props: PageProps<'/docs/[[...slug]]'>,
): Promise<Metadata> {
export async function generateMetadata(props: PageProps): Promise<Metadata> {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();

View File

@@ -1,8 +1,8 @@
import { baseOptions } from '@/lib/layout.shared';
import { source } from '@/lib/source';
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { baseOptions } from '@/lib/layout.shared';
export default function Layout({ children }: LayoutProps<'/docs'>) {
export default function Layout({ children }: { children: React.ReactNode }) {
return (
<DocsLayout tree={source.pageTree} {...baseOptions()}>
{children}

View File

@@ -28,7 +28,7 @@ export const viewport: Viewport = {
export const metadata: Metadata = getRootMetadata();
export default function Layout({ children }: LayoutProps<'/'>) {
export default function Layout({ children }: { children: React.ReactNode }) {
return (
<html
lang="en"