fix: build error

This commit is contained in:
BennyKok 2024-01-09 14:11:11 +08:00
parent 7d36f8af88
commit 8aa86bbe64
2 changed files with 27 additions and 25 deletions

View File

@ -14,7 +14,7 @@ import { handle } from "hono/vercel";
export const dynamic = "force-dynamic";
export const app = new OpenAPIHono().basePath("/api");
const app = new OpenAPIHono().basePath("/api");
declare module "hono" {
interface ContextVariableMap {

View File

@ -7,33 +7,35 @@ import _SwaggerUI from "swagger-ui-react";
import "swagger-ui-react/swagger-ui.css";
// Create the layout component
class AugmentingLayout extends React.Component {
render() {
const { getComponent } = this.props;
const BaseLayout = getComponent("BaseLayout", true);
return (
<div className="not-prose">
<BaseLayout />
</div>
);
}
}
// class AugmentingLayout extends React.Component {
// render() {
// const { getComponent } = this.props;
// const BaseLayout = getComponent("BaseLayout", true);
// return (
// <div className="not-prose">
// <BaseLayout />
// </div>
// );
// }
// }
const AugmentingLayoutPlugin = () => {
return {
components: {
AugmentingLayout: AugmentingLayout,
},
};
};
// const AugmentingLayoutPlugin = () => {
// return {
// components: {
// AugmentingLayout: AugmentingLayout,
// },
// };
// };
export default function SwaggerUI(props: ComponentProps<typeof _SwaggerUI>) {
return (
<div className="not-prose">
<_SwaggerUI
{...props}
persistAuthorization={true}
plugins={[AugmentingLayoutPlugin]}
layout="AugmentingLayout"
// plugins={[AugmentingLayoutPlugin]}
// layout="AugmentingLayout"
/>
</div>
);
}