github-docs-arabic-enhanced / src /github-apps /pages /endpoints-available-for-github-app-installation-access-tokens.tsx
AbdulElahGwaith's picture
Upload folder using huggingface_hub
88df9e4 verified
import { GetServerSideProps } from 'next'
import {
AutomatedPageContextT,
getAutomatedPageContextFromRequest,
} from '@/automated-pipelines/components/AutomatedPageContext'
import { MainContextT, getMainContext } from '@/frame/components/context/MainContext'
import { EnabledList, EnabledListT } from '@/github-apps/components/EnabledList'
type Props = {
mainContext: MainContextT
currentVersion: string
appsItems: EnabledListT
automatedPageContext: AutomatedPageContextT
categoriesWithoutSubcategories: string[]
}
export default function GitHubAppEndpoints({
mainContext,
currentVersion,
appsItems,
automatedPageContext,
categoriesWithoutSubcategories,
}: Props) {
return (
<EnabledList
items={appsItems}
currentVersion={currentVersion}
categoriesWithoutSubcategories={categoriesWithoutSubcategories}
mainContext={mainContext}
automatedPageContext={automatedPageContext}
/>
)
}
export const getServerSideProps: GetServerSideProps<Props> = async (context) => {
const { getAppsServerSideProps } = await import('@/github-apps/lib/index')
const { currentVersion, appsItems, categoriesWithoutSubcategories } =
await getAppsServerSideProps(context, 'server-to-server-rest', { useDisplayTitle: false })
return {
props: {
mainContext: await getMainContext(context.req, context.res),
currentVersion,
appsItems,
automatedPageContext: getAutomatedPageContextFromRequest(context.req),
categoriesWithoutSubcategories,
},
}
}