Add no plugins messaging
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import Box from '@mui/material/Box';
|
||||
import Button from '@mui/material/Button';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import React, { type FC } from 'react';
|
||||
|
||||
import globalize from 'lib/globalize';
|
||||
|
||||
interface NoPluginResultsProps {
|
||||
isFiltered: boolean
|
||||
onViewAll: () => void
|
||||
query: string
|
||||
}
|
||||
|
||||
const NoPluginResults: FC<NoPluginResultsProps> = ({
|
||||
isFiltered,
|
||||
onViewAll,
|
||||
query
|
||||
}) => {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
textAlign: 'center'
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
component='div'
|
||||
sx={{
|
||||
marginTop: 2,
|
||||
marginBottom: 1
|
||||
}}
|
||||
>
|
||||
{
|
||||
query ?
|
||||
globalize.translate('SearchResultsEmpty', query) :
|
||||
globalize.translate('NoSubtitleSearchResultsFound')
|
||||
}
|
||||
</Typography>
|
||||
|
||||
{isFiltered && (
|
||||
<Button
|
||||
variant='text'
|
||||
onClick={onViewAll}
|
||||
>
|
||||
{globalize.translate('ViewAllPlugins')}
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default NoPluginResults;
|
||||
@@ -12,9 +12,10 @@ import { Link } from 'react-router-dom';
|
||||
|
||||
import SearchInput from 'apps/dashboard/components/SearchInput';
|
||||
import { usePluginDetails } from 'apps/dashboard/features/plugins/api/usePluginDetails';
|
||||
import NoPluginResults from 'apps/dashboard/features/plugins/components/NoPluginResults';
|
||||
import PluginCard from 'apps/dashboard/features/plugins/components/PluginCard';
|
||||
import { PluginCategory } from 'apps/dashboard/features/plugins/constants/pluginCategory';
|
||||
import { CATEGORY_LABELS } from 'apps/dashboard/features/plugins/constants/categoryLabels';
|
||||
import { PluginCategory } from 'apps/dashboard/features/plugins/constants/pluginCategory';
|
||||
import Loading from 'components/loading/LoadingComponent';
|
||||
import Page from 'components/Page';
|
||||
import globalize from 'lib/globalize';
|
||||
@@ -178,15 +179,24 @@ export const Component = () => {
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Grid container spacing={2} columns={{ xs: 1, sm: 4, md: 9, lg: 8, xl: 10 }}>
|
||||
{filteredPlugins.map(plugin => (
|
||||
<Grid key={plugin.id} size={{ xs: 1, sm: 2, md: 3, lg: 2 }}>
|
||||
<PluginCard
|
||||
plugin={plugin}
|
||||
/>
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
{filteredPlugins.length > 0 ? (
|
||||
<Grid container spacing={2} columns={{ xs: 1, sm: 4, md: 9, lg: 8, xl: 10 }}>
|
||||
{filteredPlugins.map(plugin => (
|
||||
<Grid key={plugin.id} size={{ xs: 1, sm: 2, md: 3, lg: 2 }}>
|
||||
<PluginCard
|
||||
plugin={plugin}
|
||||
/>
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
) : (
|
||||
<NoPluginResults
|
||||
isFiltered={!!category}
|
||||
// eslint-disable-next-line react/jsx-no-bind
|
||||
onViewAll={() => setCategory(undefined)}
|
||||
query={searchQuery}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
@@ -1127,7 +1127,6 @@
|
||||
"MessageAreYouSureYouWishToRemoveMediaFolder": "Are you sure you wish to remove this media folder?",
|
||||
"MessageBackupDisclaimer": "Depending on the size of your library, the backup process may take a while.",
|
||||
"MessageBackupInProgress": "Backup in progress",
|
||||
"MessageBrowsePluginCatalog": "Browse our plugin catalog to view available plugins.",
|
||||
"MessageCancelSeriesTimerError": "An error occurred while canceling the series timer",
|
||||
"MessageCancelTimerError": "An error occurred while canceling the timer",
|
||||
"MessageChangeRecordingPath": "Changing your recording folder will not migrate existing recordings from the old location to the new. You'll need to move them manually if desired.",
|
||||
@@ -1160,13 +1159,11 @@
|
||||
"MessageLeaveEmptyToInherit": "Leave empty to inherit settings from a parent item or the global default value.",
|
||||
"MessageNoItemsAvailable": "No Items are currently available.",
|
||||
"MessageNoFavoritesAvailable": "No favorites are currently available.",
|
||||
"MessageNoAvailablePlugins": "No available plugins.",
|
||||
"MessageNoCollectionsAvailable": "Collections allow you to enjoy personalized groupings of Movies, Series, and Albums. Click the '+' button to start creating collections.",
|
||||
"MessageNoGenresAvailable": "Enable some metadata providers to pull genres from the internet.",
|
||||
"MessageNoMovieSuggestionsAvailable": "No movie suggestions are currently available. Start watching and rating your movies, and then come back to view your recommendations.",
|
||||
"MessageNoNextUpItems": "None found. Start watching your shows!",
|
||||
"MessageNoPluginConfiguration": "This plugin has no settings to set up.",
|
||||
"MessageNoPluginsInstalled": "You have no plugins installed.",
|
||||
"MessageNoRepositories": "No repositories.",
|
||||
"MessageNoServersAvailable": "No servers have been found using the automatic server discovery.",
|
||||
"MessageNothingHere": "Nothing here.",
|
||||
@@ -1609,7 +1606,6 @@
|
||||
"TabLatest": "Recently Added",
|
||||
"TabLogs": "Logs",
|
||||
"TabMusic": "Music",
|
||||
"TabMyPlugins": "My Plugins",
|
||||
"TabNetworking": "Networking",
|
||||
"TabNetworks": "TV Networks",
|
||||
"TabNfoSettings": "NFO Settings",
|
||||
@@ -1700,6 +1696,7 @@
|
||||
"VideoAudio": "Video Audio",
|
||||
"ViewAlbum": "View album",
|
||||
"ViewAlbumArtist": "View album artist",
|
||||
"ViewAllPlugins": "View all plugins",
|
||||
"ViewLyrics": "View lyrics",
|
||||
"ViewPlaybackInfo": "View playback info",
|
||||
"ViewSettings": "View settings",
|
||||
|
||||
Reference in New Issue
Block a user