From afcc8cfd4da32bfc6e28f04b14a48baea4e9ca1b Mon Sep 17 00:00:00 2001 From: Prayag Prajapati Date: Fri, 29 Dec 2023 11:00:06 +0530 Subject: [PATCH] Update search page and emptyNotice --- .../notices/emptyNotice/emptyNotice.jsx | 16 +++++++---- src/routes/search/index.jsx | 28 ++++++++++++++++++- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/components/notices/emptyNotice/emptyNotice.jsx b/src/components/notices/emptyNotice/emptyNotice.jsx index a7df361..6ed0e81 100644 --- a/src/components/notices/emptyNotice/emptyNotice.jsx +++ b/src/components/notices/emptyNotice/emptyNotice.jsx @@ -5,7 +5,7 @@ import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import { yellow } from "@mui/material/colors"; -export const EmptyNotice = () => { +export const EmptyNotice = ({ extraMsg }) => { return ( { }} >
sentiment_dissatisfied
- + No results found + + {extraMsg} +
); }; diff --git a/src/routes/search/index.jsx b/src/routes/search/index.jsx index 0a0aea3..233c1fa 100644 --- a/src/routes/search/index.jsx +++ b/src/routes/search/index.jsx @@ -12,7 +12,7 @@ import { MdiMagnify } from "../../components/icons/mdiMagnify"; import { useQuery } from "@tanstack/react-query"; import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api"; -import { getSearchApi } from "@jellyfin/sdk/lib/utils/api/search-api"; +import { EmptyNotice } from "../../components/notices/emptyNotice/emptyNotice"; import useDebounce from "../../utils/hooks/useDebounce"; @@ -179,6 +179,7 @@ const SearchPage = () => { style: { border: "100px !important", }, + autoFocus: true, startAdornment: (
{ )}
+ + {movies.isSuccess && + series.isSuccess && + audio.isSuccess && + musicAlbum.isSuccess && + book.isSuccess && + musicArtists.isSuccess && + person.isSuccess && + movies.data.Items.length == 0 && + series.data.Items.length == 0 && + audio.data.Items.length == 0 && + musicAlbum.data.Items.length == 0 && + book.data.Items.length == 0 && + musicArtists.data.Items.length == 0 && + person.data.Items.length == 0 && ( +
+ +
+ )} ); };