mirror of
https://github.com/supabase/supabase.git
synced 2026-05-09 02:09:50 -04:00
f7bf7d7ce4
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
25 lines
726 B
TypeScript
25 lines
726 B
TypeScript
import { ReactNode } from 'react'
|
|
import { cn } from 'ui'
|
|
|
|
interface DocSectionProps {
|
|
title: ReactNode
|
|
id?: string
|
|
content: ReactNode
|
|
snippets?: ReactNode
|
|
className?: string
|
|
}
|
|
|
|
export const DocSection = ({ title, id, content, snippets, className }: DocSectionProps) => {
|
|
return (
|
|
<div className={cn('grid grid-cols-1 lg:grid-cols-2 border-b', className)} id={id}>
|
|
<article className="text-foreground-light prose prose-sm p-6 lg:py-10 lg:pr-10 lg:pl-0 flex-1">
|
|
{title && <h2 className="heading-subTitle mb-4">{title}</h2>}
|
|
{content}
|
|
</article>
|
|
<article className={cn('bg flex-1 lg:border-l space-y-6 px-6 pb-6 lg:py-10')}>
|
|
{snippets}
|
|
</article>
|
|
</div>
|
|
)
|
|
}
|