From 17cb303273562e4ac647ab12186ada8a2c1f6393 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Sun, 31 Aug 2025 09:12:17 -0500 Subject: [PATCH] Refactor: Standardize string quotes and improve code formatting in ChannelCard component --- frontend/src/pages/Stats.jsx | 40 +++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/frontend/src/pages/Stats.jsx b/frontend/src/pages/Stats.jsx index 6e169997..b3178f0b 100644 --- a/frontend/src/pages/Stats.jsx +++ b/frontend/src/pages/Stats.jsx @@ -99,7 +99,7 @@ const ChannelCard = ({ // Get Date-format from localStorage const [dateFormatSetting] = useLocalStorage('date-format', 'mdy'); - const dateFormat = dateFormatSetting === 'mdy' ? "MM/DD" : "DD/MM"; + const dateFormat = dateFormatSetting === 'mdy' ? 'MM/DD' : 'DD/MM'; // Get M3U account data from the playlists store const m3uAccounts = usePlaylistsStore((s) => s.playlists); const [tableSize] = useLocalStorage('table-size', 'default'); @@ -446,13 +446,13 @@ const ChannelCard = ({ } }); } - return () => { isMounted = false; }; + return () => { + isMounted = false; + }; }, [channel.name, channel.stream_id]); const channelName = - channel.name || - previewedStream?.name || - 'Unnamed Channel'; + channel.name || previewedStream?.name || 'Unnamed Channel'; const uptime = channel.uptime || 0; const bitrates = channel.bitrates || []; const totalBytes = channel.total_bytes || 0; @@ -637,11 +637,15 @@ const ChannelCard = ({ )} {channel.ffmpeg_speed && ( - + = 1.0 ? "green" : "red"} + color={ + parseFloat(channel.ffmpeg_speed) >= 1.0 ? 'green' : 'red' + } > {parseFloat(channel.ffmpeg_speed).toFixed(2)}x @@ -900,16 +904,18 @@ const ChannelsPage = () => { No active channels currently streaming - ) : (Object.values(activeChannels).map((channel) => ( - )) + ) : ( + Object.values(activeChannels).map((channel) => ( + + )) )}