mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
36 lines
995 B
TypeScript
36 lines
995 B
TypeScript
import type { NextPage, GetServerSideProps } from 'next';
|
|
import Head from 'next/head';
|
|
import React from 'react';
|
|
|
|
import appConfig from 'configs/app/config';
|
|
import getNetworkTitle from 'lib/networks/getNetworkTitle';
|
|
import { getServerSideProps as getServerSidePropsBase } from 'lib/next/getServerSideProps';
|
|
import type { Props } from 'lib/next/getServerSideProps';
|
|
import SwaggerUI from 'ui/apiDocs/SwaggerUI';
|
|
import Page from 'ui/shared/Page/Page';
|
|
import PageTitle from 'ui/shared/Page/PageTitle';
|
|
|
|
const APIDocsPage: NextPage = () => {
|
|
const networkTitle = getNetworkTitle();
|
|
|
|
return (
|
|
<Page>
|
|
<PageTitle text="API Documentation"/>
|
|
<Head><title>{ `API for the ${ networkTitle }` }</title></Head>
|
|
<SwaggerUI/>
|
|
</Page>
|
|
);
|
|
};
|
|
|
|
export default APIDocsPage;
|
|
|
|
export const getServerSideProps: GetServerSideProps<Props> = async(args) => {
|
|
if (!appConfig.apiDoc.specUrl) {
|
|
return {
|
|
notFound: true,
|
|
};
|
|
}
|
|
|
|
return getServerSidePropsBase(args);
|
|
};
|