Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SearchForm.tsx #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions components/SearchForm.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
import Form from "next/form";
import SearchFormReset from "@/components/SearchFormReset";
import {Search} from "lucide-react";
import { Search } from "lucide-react";

const SearchForm = ({ query }: { query?: string }) => {
return (
<Form action="/" scroll={false} className="search-form">
<Form action="/" scroll={false} className="flex items-center w-full max-w-lg mx-auto p-4 bg-gray-50 rounded-lg shadow-lg">
<input
name="query"
defaultValue={query}
className="search-input"
className="flex-grow p-2 border border-gray-300 text-gray-800 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-800 transition"
placeholder="Search Startups"
type="text"
/>

<div className="flex gap-2">
<div className="flex items-center gap-2">
{query && <SearchFormReset />}

<button type="submit" className="search-btn text-white">
<Search className="size-5" />

<button
type="submit"
className="flex items-center justify-center w-10 h-10 text-white/90 bg-blue-500 rounded-full hover:bg-blue-600 focus:outline-none transition"
>
<Search className="w-5 h-5" />
</button>
</div>
</Form>
)
}
);
};

export default SearchForm
export default SearchForm;