parent
ee77e94f68
commit
fcc711d00d
2 changed files with 35 additions and 23 deletions
@ -1,14 +1,36 @@ |
|||||||
import React from "react"; |
import React, { useState } from "react"; |
||||||
|
|
||||||
|
import search from "./search-normal.svg"; |
||||||
|
import settings from "./settings.svg"; |
||||||
|
|
||||||
export const ColumnSearch = ({ column }) => { |
export const ColumnSearch = ({ column }) => { |
||||||
const { filterValue, setFilter } = column; |
const { filterValue, setFilter } = column; |
||||||
|
const [activeSearchBox, setActiveSearchBox] = useState(false); |
||||||
|
|
||||||
return ( |
return ( |
||||||
<span> |
<div className="rounded-md flex flex-row items-center"> |
||||||
<input |
<div className="flex flex-row items-center relative"> |
||||||
value={filterValue || ""} |
{activeSearchBox && ( |
||||||
onChange={(e) => setFilter(e.target.value)} |
<img |
||||||
/> |
src={settings} |
||||||
</span> |
alt="" |
||||||
|
className="w-4 h-4 absolute left-7 cursor-pointer" |
||||||
|
onClick={() => setActiveSearchBox(false)} |
||||||
|
/> |
||||||
|
)} |
||||||
|
<img |
||||||
|
src={search} |
||||||
|
alt="" |
||||||
|
className="w-4 h-4 absolute left-2 cursor-pointer" |
||||||
|
/> |
||||||
|
<input |
||||||
|
value={filterValue || ""} |
||||||
|
onChange={(e) => setFilter(e.target.value)} |
||||||
|
onFocus={() => setActiveSearchBox(true)} |
||||||
|
className={`text-xs text-blue-400 rounded focus:outline-none placeholder-blue-400 border p-1`} |
||||||
|
style={{ backgroundColor: "#F9FBFF", borderColor: "#B5D6FF" }} |
||||||
|
/> |
||||||
|
</div> |
||||||
|
</div> |
||||||
); |
); |
||||||
}; |
}; |
||||||
|
Loading…
Reference in new issue