import { useState } from 'react'
import { Light as SyntaxHighlighter } from 'react-syntax-highlighter'
import js from 'react-syntax-highlighter/dist/cjs/languages/hljs/javascript'
import CopyToClipboard from 'react-copy-to-clipboard'
import {
createUserExample,
subscribeExample,
readExample,
createExample,
updateExample,
ExampleProps,
} from 'data/CodeExamples'
import monokaiCustomTheme from 'data/CodeEditorTheme'
import { Button, IconCopy, Space, Tabs } from '@supabase/ui'
SyntaxHighlighter.registerLanguage('javascript', js)
const ClipboardIcon = () => (
)
const CopiedIcon = () => (
)
const CodeExamples = () => {
const [example, setExample] = useState('createUserExample')
const [copied, setCopied] = useState(false)
type exampleListProps = {
[key: string]: ExampleProps
}
const exampleList: exampleListProps = {
createUserExample,
subscribeExample,
readExample,
createExample,
updateExample,
}
const lang = 'javascript'
function handleClick(key: string) {
setExample(key)
setCopied(false)
}
const Buttons = () => (
{exampleList[example].description}