GeneralContent.tsx30 lines · main
1import { DocSection } from './DocSection'
2import Authentication from '@/components/interfaces/Docs/Authentication'
3import Introduction from '@/components/interfaces/Docs/Introduction'
4import RpcIntroduction from '@/components/interfaces/Docs/Pages/Rpc/Introduction'
5import TablesIntroduction from '@/components/interfaces/Docs/Pages/Tables/Introduction'
6import { UserManagement } from '@/components/interfaces/Docs/Pages/UserManagement'
7
8interface GeneralContentProps {
9 page?: string
10 selectedLang: 'bash' | 'js'
11 showApiKey: string
12}
13
14export const GeneralContent = ({ selectedLang, page, showApiKey }: GeneralContentProps) => {
15 let selected = page?.toLowerCase()
16 if (selected == 'intro' || selected == null) return <Introduction selectedLang={selectedLang} />
17 if (selected == 'auth')
18 return <Authentication selectedLang={selectedLang} showApiKey={showApiKey} />
19 if (selected == 'users-management')
20 return <UserManagement selectedLang={selectedLang} showApiKey={showApiKey} />
21 if (selected == 'tables-intro') return <TablesIntroduction selectedLang={selectedLang} />
22 if (selected == 'rpc-intro') return <RpcIntroduction />
23 else
24 return (
25 <DocSection
26 title="Not found"
27 content={<p>Looks like you went somewhere that nobody knows.</p>}
28 />
29 )
30}