GeneralContent.tsx30 lines · main
| 1 | import { DocSection } from './DocSection' |
| 2 | import Authentication from '@/components/interfaces/Docs/Authentication' |
| 3 | import Introduction from '@/components/interfaces/Docs/Introduction' |
| 4 | import RpcIntroduction from '@/components/interfaces/Docs/Pages/Rpc/Introduction' |
| 5 | import TablesIntroduction from '@/components/interfaces/Docs/Pages/Tables/Introduction' |
| 6 | import { UserManagement } from '@/components/interfaces/Docs/Pages/UserManagement' |
| 7 | |
| 8 | interface GeneralContentProps { |
| 9 | page?: string |
| 10 | selectedLang: 'bash' | 'js' |
| 11 | showApiKey: string |
| 12 | } |
| 13 | |
| 14 | export 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 | } |