mirror of
https://github.com/supabase/supabase.git
synced 2026-07-06 22:34:54 +08:00
28 lines
609 B
TypeScript
28 lines
609 B
TypeScript
import { Code } from 'lucide-react'
|
|
import { useAppStateSnapshot } from 'state/app-state'
|
|
import { Button } from 'ui'
|
|
|
|
interface APIDocsButtonProps {
|
|
section?: string[]
|
|
}
|
|
|
|
const APIDocsButton = ({ section }: APIDocsButtonProps) => {
|
|
const snap = useAppStateSnapshot()
|
|
|
|
return (
|
|
<Button
|
|
size="tiny"
|
|
type="default"
|
|
onClick={() => {
|
|
if (section) snap.setActiveDocsSection(section)
|
|
snap.setShowProjectApiDocs(true)
|
|
}}
|
|
icon={<Code strokeWidth={1.5} className="text-foreground-muted" />}
|
|
>
|
|
API Docs
|
|
</Button>
|
|
)
|
|
}
|
|
|
|
export default APIDocsButton
|