mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 03:55:38 -04:00
fix: use createOpenAPIPage from fumadocs-openapi
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"use client";
|
||||
import { defineClientConfig } from "fumadocs-openapi/ui/client";
|
||||
import { createOpenAPIPage } from "fumadocs-openapi/ui";
|
||||
|
||||
export default defineClientConfig({});
|
||||
export const OpenAPIPage = createOpenAPIPage({});
|
||||
|
||||
@@ -1,7 +1,22 @@
|
||||
import { createAPIPage } from "fumadocs-openapi/ui";
|
||||
import type { OpenAPIPageProps_Preloaded } from "fumadocs-openapi/ui";
|
||||
|
||||
import { openapi } from "@/lib/openapi";
|
||||
|
||||
import client from "./api-page.client";
|
||||
import { OpenAPIPage } from "./api-page.client";
|
||||
|
||||
export const APIPage = createAPIPage(openapi, { client });
|
||||
type APIPageProps = Omit<OpenAPIPageProps_Preloaded, "preloaded">;
|
||||
|
||||
export async function APIPage(props: APIPageProps) {
|
||||
const { document, ...pageProps } = props;
|
||||
const { bundled } = await openapi.getSchema(document);
|
||||
|
||||
return (
|
||||
<OpenAPIPage
|
||||
{...pageProps}
|
||||
payload={{
|
||||
bundled,
|
||||
proxyUrl: openapi.options.proxyUrl,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user