docs: fix types
This commit is contained in:
@@ -216,3 +216,4 @@ tracker = OpenPanel::SDK::Tracker.new(
|
|||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,11 @@ import {
|
|||||||
import type { Metadata } from 'next';
|
import type { Metadata } from 'next';
|
||||||
import { notFound } from 'next/navigation';
|
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 params = await props.params;
|
||||||
const page = source.getPage(params.slug);
|
const page = source.getPage(params.slug);
|
||||||
if (!page) notFound();
|
if (!page) notFound();
|
||||||
@@ -39,9 +43,7 @@ export async function generateStaticParams() {
|
|||||||
return source.generateParams();
|
return source.generateParams();
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function generateMetadata(
|
export async function generateMetadata(props: PageProps): Promise<Metadata> {
|
||||||
props: PageProps<'/docs/[[...slug]]'>,
|
|
||||||
): Promise<Metadata> {
|
|
||||||
const params = await props.params;
|
const params = await props.params;
|
||||||
const page = source.getPage(params.slug);
|
const page = source.getPage(params.slug);
|
||||||
if (!page) notFound();
|
if (!page) notFound();
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
import { baseOptions } from '@/lib/layout.shared';
|
||||||
import { source } from '@/lib/source';
|
import { source } from '@/lib/source';
|
||||||
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
|
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 (
|
return (
|
||||||
<DocsLayout tree={source.pageTree} {...baseOptions()}>
|
<DocsLayout tree={source.pageTree} {...baseOptions()}>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export const viewport: Viewport = {
|
|||||||
|
|
||||||
export const metadata: Metadata = getRootMetadata();
|
export const metadata: Metadata = getRootMetadata();
|
||||||
|
|
||||||
export default function Layout({ children }: LayoutProps<'/'>) {
|
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<html
|
<html
|
||||||
lang="en"
|
lang="en"
|
||||||
|
|||||||
Reference in New Issue
Block a user