mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-09 23:15:46 +01:00
✨ Add preview if media is available on Plex
This commit is contained in:
@@ -41,6 +41,7 @@ export default function SearchBar(props: any) {
|
||||
const queryUrl = config.settings.searchUrl ?? 'https://www.google.com/search?q=';
|
||||
|
||||
const [OverseerrResults, setOverseerrResults] = useState<any[]>([]);
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [icon, setIcon] = useState(<Search />);
|
||||
const [results, setResults] = useState<any[]>([]);
|
||||
const [opened, setOpened] = useState(false);
|
||||
@@ -82,7 +83,9 @@ export default function SearchBar(props: any) {
|
||||
)
|
||||
.then((res) => {
|
||||
setOverseerrResults(res.data.results ?? []);
|
||||
setLoading(false);
|
||||
});
|
||||
setLoading(true);
|
||||
} else {
|
||||
setOverseerrResults([]);
|
||||
axios
|
||||
@@ -142,10 +145,9 @@ export default function SearchBar(props: any) {
|
||||
})}
|
||||
>
|
||||
<Popover
|
||||
opened={opened}
|
||||
opened={OverseerrResults.length > 0 && opened}
|
||||
position="bottom"
|
||||
placement="start"
|
||||
withArrow
|
||||
radius="md"
|
||||
trapFocus={false}
|
||||
transition="pop-bottom-right"
|
||||
|
||||
Reference in New Issue
Block a user