feat: add button to clear collection search

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
dw-0 2023-10-13 17:31:21 +02:00
parent 6b668aaebe
commit 97871c25cf

View File

@ -5,7 +5,8 @@ import {
IconFolders,
IconArrowsSort,
IconSortAscendingLetters,
IconSortDescendingLetters
IconSortDescendingLetters,
IconX
} from '@tabler/icons';
import Collection from '../Collections/Collection';
import CreateCollection from '../CreateCollection';
@ -97,8 +98,20 @@ const Collections = () => {
spellCheck="false"
className="block w-full pl-7 py-1 sm:text-sm"
placeholder="search"
value={searchText}
onChange={(e) => setSearchText(e.target.value.toLowerCase())}
/>
{searchText !== '' && (
<div className="absolute inset-y-0 right-0 pr-4 flex items-center">
<span
onClick={() => {
setSearchText('');
}}
>
<IconX size={16} strokeWidth={1.5} />
</span>
</div>
)}
</div>
<div className="mt-4 flex flex-col overflow-y-auto absolute top-32 bottom-10 left-0 right-0">