|
|
@@ -3,24 +3,21 @@ import { cn } from '@/lib/utils'
|
|
|
import { useSearch } from '@/context/search-provider'
|
|
|
import { Button } from './ui/button'
|
|
|
|
|
|
-type SearchProps = {
|
|
|
- className?: string
|
|
|
- type?: React.HTMLInputTypeAttribute
|
|
|
- placeholder?: string
|
|
|
-}
|
|
|
-
|
|
|
export function Search({
|
|
|
className = '',
|
|
|
placeholder = 'Search',
|
|
|
-}: SearchProps) {
|
|
|
+ ...props
|
|
|
+}: React.ComponentProps<'button'> & { placeholder?: string }) {
|
|
|
const { setOpen } = useSearch()
|
|
|
return (
|
|
|
<Button
|
|
|
+ {...props}
|
|
|
variant='outline'
|
|
|
className={cn(
|
|
|
'group relative h-8 w-full flex-1 justify-start rounded-md bg-muted/25 text-sm font-normal text-muted-foreground shadow-none hover:bg-accent sm:w-40 sm:pe-12 md:flex-none lg:w-52 xl:w-64',
|
|
|
className
|
|
|
)}
|
|
|
+ aria-keyshortcuts='Meta+K Control+K'
|
|
|
onClick={() => setOpen(true)}
|
|
|
>
|
|
|
<SearchIcon
|