mirror of
https://github.com/supabase/supabase.git
synced 2026-07-07 01:34:22 +08:00
* init * fix build issues * move deps over * Update CommandMenuWrapper.tsx * build fixes * Update sitemap_www.xml * reset * Update sitemap_www.xml * Update tsconfig.json * Update package.json * Update package.json * Update package-lock.json * Update package.json
28 lines
649 B
TypeScript
28 lines
649 B
TypeScript
import { ButtonHTMLAttributes, DetailedHTMLProps, PropsWithChildren, useRef } from 'react'
|
|
import { useCommandMenu } from './CommandMenuProvider'
|
|
|
|
const SearchButton = ({
|
|
children,
|
|
className,
|
|
...props
|
|
}: PropsWithChildren<
|
|
DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>
|
|
>) => {
|
|
const searchButtonRef = useRef<HTMLButtonElement>(null)
|
|
const { setIsOpen, site } = useCommandMenu()
|
|
|
|
return (
|
|
<button
|
|
type="button"
|
|
ref={searchButtonRef}
|
|
onClick={() => setIsOpen(true)}
|
|
className={className}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</button>
|
|
)
|
|
}
|
|
|
|
export default SearchButton
|