import { Link } from 'react-router-dom'; import { ChannelType } from '../pages/Channels'; import Routes from '../configuration/routes/RouteList'; import updateChannelSubscription from '../api/actions/updateChannelSubscription'; import formatDate from '../functions/formatDates'; import FormattedNumber from './FormattedNumber'; import Button from './Button'; import ChannelIcon from './ChannelIcon'; import ChannelBanner from './ChannelBanner'; import { useUserConfigStore } from '../stores/UserConfigStore'; type ChannelListProps = { channelList: ChannelType[] | undefined; refreshChannelList: (refresh: boolean) => void; }; const ChannelList = ({ channelList, refreshChannelList }: ChannelListProps) => { const { userConfig } = useUserConfigStore(); const viewStyle = userConfig.view_style_channel; if (!channelList || channelList.length === 0) { return

No channels found.

; } return ( <> {channelList.map(channel => { return (

{channel.channel_name}

{channel.channel_subs !== null && ( )}

Last refreshed: {formatDate(channel.channel_last_refresh)}

{channel.channel_subscribed && (
); })} ); }; export default ChannelList;