frontend: add message panels to search. disable to search empty query.

This commit is contained in:
Kentai Radiquum 2024-04-27 23:50:57 +05:00
parent baaa67f2ab
commit 3fdf67c860
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
2 changed files with 44 additions and 33 deletions

View file

@ -1,7 +1,5 @@
"use client";
import Link from "next/link";
export const LogInNeeded = (props) => {
return (
<div className="absolute padding error center middle round">

View file

@ -69,6 +69,7 @@ export default function Search() {
const handleSubmit = async (e) => {
e.preventDefault();
if (query != "") {
router.push(pathname + "?" + createQueryString("query", query));
setReleases(null);
setPage(0);
@ -85,6 +86,7 @@ export default function Search() {
saveSearches(JSON.stringify([query, ...searches.slice(0, 5)]));
}
}
}
};
return (
@ -115,6 +117,7 @@ export default function Search() {
</div>
{releases ? (
releases.lenght > 0 ? (
<>
<div className="grid">
<CardList data={releases} />
@ -133,8 +136,18 @@ export default function Search() {
</nav>
</>
) : (
// <progress className="s1"></progress>
""
<div className="absolute padding primary center middle small-round">
<i className="extra">search</i>
<h5>Ничего не найдено.</h5>
<p>Введите другой поисковой запрос.</p>
</div>
)
) : (
<div className="absolute padding primary center middle small-round">
<i className="extra">search</i>
<h5>Здесь пока ничего нет.</h5>
<p>Введите поисковой запрос для начала поиска.</p>
</div>
)}
</>
);