31 lines
811 B
TypeScript
31 lines
811 B
TypeScript
import { Search } from "lucide-react";
|
|
|
|
import { Label } from "@/components/ui/label";
|
|
import {
|
|
SidebarGroup,
|
|
SidebarGroupContent,
|
|
SidebarInput,
|
|
} from "@/components/ui/sidebar";
|
|
import { useId } from "react";
|
|
|
|
export function SearchForm({ ...props }: React.ComponentProps<"form">) {
|
|
const inputId = useId();
|
|
return (
|
|
<form {...props}>
|
|
<SidebarGroup className="py-0">
|
|
<SidebarGroupContent className="relative">
|
|
<Label htmlFor={inputId} className="sr-only">
|
|
Search
|
|
</Label>
|
|
<SidebarInput
|
|
name="q"
|
|
id={inputId}
|
|
placeholder="Vyhledat v programu..."
|
|
className="pl-8"
|
|
/>
|
|
<Search className="pointer-events-none absolute top-1/2 left-2 size-4 -translate-y-1/2 opacity-50 select-none" />
|
|
</SidebarGroupContent>
|
|
</SidebarGroup>
|
|
</form>
|
|
);
|
|
}
|