mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
useSites Hook & Searchbar & Layout component
This commit is contained in:
38
components/SearchAndLayout.tsx
Normal file
38
components/SearchAndLayout.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import { ChangeEvent } from "react";
|
||||
|
||||
interface SearchAndLayoutProps {
|
||||
search: string;
|
||||
setSearch: (value: string) => void;
|
||||
itemPerPage: number;
|
||||
setItemPerPage: (value: number) => void;
|
||||
}
|
||||
|
||||
const SearchAndLayout = ({
|
||||
search,
|
||||
setSearch,
|
||||
itemPerPage,
|
||||
setItemPerPage
|
||||
}: SearchAndLayoutProps) => (
|
||||
<div className="flex gap-2 items-center pt-4">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Search..."
|
||||
className="input input-bordered w-full"
|
||||
value={search}
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) => setSearch(e.target.value)}
|
||||
/>
|
||||
<select
|
||||
className="select w-24"
|
||||
value={itemPerPage}
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) =>
|
||||
setItemPerPage(Number(e.target.value))
|
||||
}
|
||||
>
|
||||
<option disabled>Layout</option>
|
||||
<option value={5}>List</option>
|
||||
<option value={10}>Grid</option>
|
||||
</select>
|
||||
</div>
|
||||
);
|
||||
|
||||
export default SearchAndLayout;
|
||||
Reference in New Issue
Block a user