mirror of
https://github.com/supabase/supabase.git
synced 2026-10-14 13:49:09 +03:00
* Shift refresh button to header in table editor and make realtime button + api docs button smaller * Fix ts
31 lines
685 B
TypeScript
31 lines
685 B
TypeScript
import { BookOpenText } from 'lucide-react'
|
|
import { useAppStateSnapshot } from 'state/app-state'
|
|
import { ButtonTooltip } from './ButtonTooltip'
|
|
|
|
interface APIDocsButtonProps {
|
|
section?: string[]
|
|
}
|
|
|
|
export const APIDocsButton = ({ section }: APIDocsButtonProps) => {
|
|
const snap = useAppStateSnapshot()
|
|
|
|
return (
|
|
<ButtonTooltip
|
|
size="tiny"
|
|
type="default"
|
|
onClick={() => {
|
|
if (section) snap.setActiveDocsSection(section)
|
|
snap.setShowProjectApiDocs(true)
|
|
}}
|
|
icon={<BookOpenText />}
|
|
className="h-7 w-7"
|
|
tooltip={{
|
|
content: {
|
|
side: 'bottom',
|
|
text: 'API Docs',
|
|
},
|
|
}}
|
|
/>
|
|
)
|
|
}
|