From 5a75c4551b3f6cc28aa7e9bef2dc56a36a8a494b Mon Sep 17 00:00:00 2001
From: real-zephex <zephex-1@outlook.com>
Date: Mon, 13 May 2024 21:23:36 +0530
Subject: added loading.jsx file and it's css subpart

---
 src/app/anime/components/search.jsx | 9 +++++++++
 1 file changed, 9 insertions(+)

(limited to 'src/app/anime/components/search.jsx')

diff --git a/src/app/anime/components/search.jsx b/src/app/anime/components/search.jsx
index b8b4b53..66c491a 100644
--- a/src/app/anime/components/search.jsx
+++ b/src/app/anime/components/search.jsx
@@ -10,9 +10,13 @@ import SearchResults from "./search_results";
 const SearcBar = () => {
 	const [title, setTitle] = useState("");
 	const [searchResults, setSearchResults] = useState(null);
+	const [loading, setLoading] = useState(false);
 
 	const handleSearchInput = async (title) => {
+		setSearchResults(null);
+		setLoading(true);
 		setSearchResults(await SearchResults(title));
+		setLoading(false);
 	};
 
 	return (
@@ -47,6 +51,11 @@ const SearcBar = () => {
 					</button>
 				</Link>
 			</section>
+			{loading && (
+				<p className={styles.SearchLoading}>
+					Please wait while we crunch up all the data.....
+				</p>
+			)}
 			{searchResults}
 		</main>
 	);
-- 
cgit v1.2.3

