SearchInput.tsx 652 B

12345678910111213141516171819202122232425
  1. import { Search } from "lucide-react";
  2. import { Input } from "@/components/ui/input";
  3. export function SearchInput({
  4. value,
  5. onChange,
  6. placeholder = "Search",
  7. }: {
  8. value: string;
  9. onChange: (value: string) => void;
  10. placeholder?: string;
  11. }) {
  12. return (
  13. <label className="relative block w-full sm:w-72">
  14. <Search className="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />
  15. <Input
  16. aria-label={placeholder}
  17. className="pl-9"
  18. value={value}
  19. onChange={(event) => onChange(event.target.value)}
  20. placeholder={placeholder}
  21. />
  22. </label>
  23. );
  24. }