mirror of
https://github.com/supabase/supabase.git
synced 2026-07-03 16:54:21 +08:00
* Clean up unneeded files and exports in packages/ui. * Fix references to LogoLoader. * Import SimpleCodeblock directly from ui package.
24 lines
599 B
TypeScript
24 lines
599 B
TypeScript
import { SimpleCodeBlock } from 'ui'
|
|
|
|
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
|