diff --git a/frontend/src/components/ChannelList.tsx b/frontend/src/components/ChannelList.tsx index 75319fe5..7df96c8e 100644 --- a/frontend/src/components/ChannelList.tsx +++ b/frontend/src/components/ChannelList.tsx @@ -7,6 +7,7 @@ import FormattedNumber from './FormattedNumber'; import Button from './Button'; import ChannelIcon from './ChannelIcon'; import ChannelBanner from './ChannelBanner'; +import LoadingIndicator from './LoadingIndicator'; import { useUserConfigStore } from '../stores/UserConfigStore'; type ChannelListProps = { @@ -18,8 +19,11 @@ const ChannelList = ({ channelList, refreshChannelList }: ChannelListProps) => { const { userConfig } = useUserConfigStore(); const viewStyle = userConfig.view_style_channel; - if (!channelList || channelList.length === 0) { - return

No channels found.

; + if (!channelList) { + return ; + } + if (channelList.length === 0) { + return

No channels found...

; } return ( diff --git a/frontend/src/components/PlaylistList.tsx b/frontend/src/components/PlaylistList.tsx index 555d1e83..91322b60 100644 --- a/frontend/src/components/PlaylistList.tsx +++ b/frontend/src/components/PlaylistList.tsx @@ -4,6 +4,7 @@ import updatePlaylistSubscription from '../api/actions/updatePlaylistSubscriptio import formatDate from '../functions/formatDates'; import Button from './Button'; import PlaylistThumbnail from './PlaylistThumbnail'; +import LoadingIndicator from './LoadingIndicator'; import { useUserConfigStore } from '../stores/UserConfigStore'; import { PlaylistType } from '../api/loader/loadPlaylistById'; @@ -16,8 +17,11 @@ const PlaylistList = ({ playlistList, setRefresh }: PlaylistListProps) => { const { userConfig } = useUserConfigStore(); const viewStyle = userConfig.view_style_playlist; - if (!playlistList || playlistList.length === 0) { - return

No playlists found.

; + if (!playlistList) { + return ; + } + if (playlistList.length === 0) { + return

No playlists found...

; } return ( diff --git a/frontend/src/components/VideoList.tsx b/frontend/src/components/VideoList.tsx index bff8217c..28737a1c 100644 --- a/frontend/src/components/VideoList.tsx +++ b/frontend/src/components/VideoList.tsx @@ -2,6 +2,7 @@ import { ViewStylesEnum, ViewStylesType } from '../configuration/constants/ViewS import { VideoType } from '../pages/Home'; import VideoListItem from './VideoListItem'; import VideoListItemTable from './VideoListItemTable'; +import LoadingIndicator from './LoadingIndicator'; type VideoListProps = { videoList: VideoType[] | undefined; @@ -18,8 +19,11 @@ const VideoList = ({ showReorderButton = false, refreshVideoList, }: VideoListProps) => { - if (!videoList || videoList.length === 0) { - return

No videos found.

; + if (!videoList) { + return ; + } + if (videoList.length === 0) { + return

No videos found...

; } if (viewStyle === ViewStylesEnum.Table) { diff --git a/frontend/src/pages/ChannelVideo.tsx b/frontend/src/pages/ChannelVideo.tsx index 981c9aae..07c441b6 100644 --- a/frontend/src/pages/ChannelVideo.tsx +++ b/frontend/src/pages/ChannelVideo.tsx @@ -168,17 +168,13 @@ const ChannelVideo = ({ videoType }: ChannelVideoProps) => {
- {!hasVideos && ( - <> -

No videos found...

-

- Try going to the downloads page to start the - scan and download tasks. -

- - )} - + {!hasVideos && ( +

+ Try going to the downloads page to start the scan + and download tasks. +

+ )}
{pagination && ( diff --git a/frontend/src/pages/Channels.tsx b/frontend/src/pages/Channels.tsx index 40e6dc2a..4477d363 100644 --- a/frontend/src/pages/Channels.tsx +++ b/frontend/src/pages/Channels.tsx @@ -59,7 +59,6 @@ const Channels = () => { const channels = channelListResponseData?.data; const pagination = channelListResponseData?.paginate; - const hasChannels = channels?.length !== 0; const handleUserConfigUpdate = async (config: Partial) => { const updatedUserConfig = await updateUserConfig(config); @@ -195,9 +194,7 @@ const Channels = () => {
- {!hasChannels &&

No channels found...

} - - {hasChannels && } +
{pagination && ( diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx index be016f6e..e7b1c8d8 100644 --- a/frontend/src/pages/Home.tsx +++ b/frontend/src/pages/Home.tsx @@ -197,23 +197,17 @@ const Home = () => {
+ {!hasVideos && ( - <> -

No videos found...

-

- If you've already added a channel or playlist, try going to the{' '} - downloads page to start the scan and download - tasks. -

- - )} - - {hasVideos && ( - +

+ If you've already added a channel or playlist, try going to the{' '} + downloads page to start the scan and download + tasks. +

)}
diff --git a/frontend/src/pages/Playlist.tsx b/frontend/src/pages/Playlist.tsx index 9e19a669..9bcb4c45 100644 --- a/frontend/src/pages/Playlist.tsx +++ b/frontend/src/pages/Playlist.tsx @@ -349,16 +349,21 @@ const Playlist = () => {
+ {videoInPlaylistCount === 0 && ( <> -

No videos found...

{isCustomPlaylist && (

Try going to the home page to add videos to this playlist.

)} - {!isCustomPlaylist && (

Try going to the downloads page to start the @@ -367,15 +372,6 @@ const Playlist = () => { )} )} - {videoInPlaylistCount !== 0 && ( - - )}

diff --git a/frontend/src/pages/Playlists.tsx b/frontend/src/pages/Playlists.tsx index cace95c0..91820c97 100644 --- a/frontend/src/pages/Playlists.tsx +++ b/frontend/src/pages/Playlists.tsx @@ -38,8 +38,6 @@ const Playlists = () => { const playlistList = playlistResponseData?.data; const pagination = playlistResponseData?.paginate; - const hasPlaylists = playlistResponseData?.data?.length !== 0; - const viewStyle = userConfig.view_style_playlist; const showSubedOnly = userConfig.show_subed_only; @@ -197,9 +195,7 @@ const Playlists = () => {
- {!hasPlaylists &&

No playlists found...

} - - {hasPlaylists && } +