39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
// * Packages
|
|
import { SearchIcon } from "lucide-react";
|
|
import { useForm } from "@inertiajs/react";
|
|
// * Components shadcn
|
|
import { Button } from "@/components/ui/button";
|
|
// * Other
|
|
import InputError from "@/front/Components/Base/InputError";
|
|
import {
|
|
InputGroup,
|
|
InputGroupAddon,
|
|
InputGroupInput,
|
|
} from "@/components/ui/input-group";
|
|
|
|
export default function SearchInput() {
|
|
const { data, setData, processing, errors } = useForm({
|
|
search: "",
|
|
});
|
|
const submit = (e) => {
|
|
e.preventDefault();
|
|
};
|
|
return (
|
|
<form onSubmit={submit}>
|
|
<InputGroup className="rounded-full">
|
|
<InputGroupInput
|
|
value={data.search}
|
|
onChange={(e) => setData("search", e.target.value)}
|
|
disabled={processing}
|
|
placeholder="Rechercher..."
|
|
/>
|
|
<InputGroupAddon align="inline-end">
|
|
<Button variant="ghost" className="rounded-full w-7 py-0 h-7">
|
|
<SearchIcon />
|
|
</Button>
|
|
</InputGroupAddon>
|
|
</InputGroup>
|
|
<InputError message={errors?.search} />
|
|
</form>
|
|
);
|
|
}
|