GeneralContent.tsx 1.3 KB

123456789101112131415161718192021222324252627282930
  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. interface GeneralContentProps {
  8. page?: string
  9. selectedLang: 'bash' | 'js'
  10. showApiKey: string
  11. }
  12. export const GeneralContent = ({ selectedLang, page, showApiKey }: GeneralContentProps) => {
  13. let selected = page?.toLowerCase()
  14. if (selected == 'intro' || selected == null) return <Introduction selectedLang={selectedLang} />
  15. if (selected == 'auth')
  16. return <Authentication selectedLang={selectedLang} showApiKey={showApiKey} />
  17. if (selected == 'users-management')
  18. return <UserManagement selectedLang={selectedLang} showApiKey={showApiKey} />
  19. if (selected == 'tables-intro') return <TablesIntroduction selectedLang={selectedLang} />
  20. if (selected == 'rpc-intro') return <RpcIntroduction />
  21. else
  22. return (
  23. <DocSection
  24. title="Not found"
  25. content={<p>Looks like you went somewhere that nobody knows.</p>}
  26. />
  27. )
  28. }