From 9773f4fc02d0b639ccf2ba5b31acc04d83e10140 Mon Sep 17 00:00:00 2001 From: Tamir Abutbul <1tamir198@gmail.com> Date: Fri, 29 Mar 2024 19:12:12 +0300 Subject: [PATCH] Remove file from inputs folder --- components/Common/inputs/SearchInput.tsx | 48 ------------------------ 1 file changed, 48 deletions(-) delete mode 100644 components/Common/inputs/SearchInput.tsx diff --git a/components/Common/inputs/SearchInput.tsx b/components/Common/inputs/SearchInput.tsx deleted file mode 100644 index 6336b333..00000000 --- a/components/Common/inputs/SearchInput.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import React, { useState } from 'react'; -import Image from 'next/image'; - -type SearchInputProps = { - onChange: (value: string) => void; - placeHolderText: string; - backgroundColor?: string; - darkBackgroundColor?: string; -}; - -export const SearchInput = ({ - placeHolderText = 'חיפוש...', - backgroundColor = 'bg-gray-50', - darkBackgroundColor = 'bg-gray-600', - onChange, -}: SearchInputProps) => { - const timeOutIdRef = React.useRef(); - const [lastSearchTerm, setLastSearchTerm] = useState(''); - - const handleSearchChange = (event: React.ChangeEvent) => { - if (timeOutIdRef.current) clearTimeout(timeOutIdRef.current); - - timeOutIdRef.current = setTimeout(() => { - if (event.target.value === lastSearchTerm) return; - onChange(event.target.value); - setLastSearchTerm(event.target.value); - }, 500) as unknown as number; - }; - - return ( -
- - - search -
- ); -};