mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
Feature / Refactor ## What is the current behavior? Data API docs live at the `/api` route as a standalone page. Old links point to the previous location. ## What is the new behavior? Data API docs are moved to the integrations section with a dedicated docs tab and settings tab. Old links are cleaned up, a mobile menu is added for data API docs navigation, and minor code review fixes are applied. ## Additional context Resolves FE-2517 ## Summary by CodeRabbit * **New Features** * Revamped API docs UI with reusable section layout, language toggle (JS/Bash), API key selection, and improved code snippets * Added Data API docs tab, mobile navigation, and dedicated loading/error/disabled states * **Navigation Updates** * Moved API docs and related links into the Integrations/Data API area and added redirects to new routes * Updated various internal links to the new Data API settings and overview locations * **Tests** * Added comprehensive unit tests for Data API utilities
31 lines
1.3 KiB
TypeScript
31 lines
1.3 KiB
TypeScript
import { DocSection } from './DocSection'
|
|
import Authentication from '@/components/interfaces/Docs/Authentication'
|
|
import Introduction from '@/components/interfaces/Docs/Introduction'
|
|
import RpcIntroduction from '@/components/interfaces/Docs/Pages/Rpc/Introduction'
|
|
import TablesIntroduction from '@/components/interfaces/Docs/Pages/Tables/Introduction'
|
|
import { UserManagement } from '@/components/interfaces/Docs/Pages/UserManagement'
|
|
|
|
interface GeneralContentProps {
|
|
page?: string
|
|
selectedLang: 'bash' | 'js'
|
|
showApiKey: string
|
|
}
|
|
|
|
export const GeneralContent = ({ selectedLang, page, showApiKey }: GeneralContentProps) => {
|
|
let selected = page?.toLowerCase()
|
|
if (selected == 'intro' || selected == null) return <Introduction selectedLang={selectedLang} />
|
|
if (selected == 'auth')
|
|
return <Authentication selectedLang={selectedLang} showApiKey={showApiKey} />
|
|
if (selected == 'users-management')
|
|
return <UserManagement selectedLang={selectedLang} showApiKey={showApiKey} />
|
|
if (selected == 'tables-intro') return <TablesIntroduction selectedLang={selectedLang} />
|
|
if (selected == 'rpc-intro') return <RpcIntroduction />
|
|
else
|
|
return (
|
|
<DocSection
|
|
title="Not found"
|
|
content={<p>Looks like you went somewhere that nobody knows.</p>}
|
|
/>
|
|
)
|
|
}
|