mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 14:19:11 +03:00
* Reinstate API docs files and pages * Add API side panel back to feature preview * Nav bar to link to api page if feature is not toggled * Hide API docs button behind feature preview for auth users, storage and edge functions * Use new API side panel for table editor, and update the language selector to make it more apparent * Fix feature preview modal styling * Merge master resolve conflicts * Add URL to graphiql in API docs side panel, which links to /api/graphiql without the docs layout menu * Add auth enabled flag for user management section in Docs * Add realtime enabled flag for subscribe to changes section in Docs * Add realtime enabled flag for API docs side panel * Update redirect next config
24 lines
633 B
TypeScript
24 lines
633 B
TypeScript
import SimpleCodeBlock from 'components/to-be-cleaned/SimpleCodeBlock'
|
|
|
|
interface CodeSnippetProps {
|
|
selectedLang: 'bash' | 'js'
|
|
snippet: {
|
|
title?: string
|
|
bash: { language?: string; code: string }
|
|
js?: { language?: string; code: string }
|
|
}
|
|
}
|
|
|
|
const CodeSnippet = ({ selectedLang, snippet }: CodeSnippetProps) => {
|
|
if (!snippet[selectedLang]) return null
|
|
return (
|
|
<div className="codeblock-container">
|
|
<h4>{snippet.title}</h4>
|
|
<SimpleCodeBlock className={snippet[selectedLang]?.language}>
|
|
{snippet[selectedLang]?.code}
|
|
</SimpleCodeBlock>
|
|
</div>
|
|
)
|
|
}
|
|
export default CodeSnippet
|