diff --git a/frontend/src/components/tables/StreamsTable.jsx b/frontend/src/components/tables/StreamsTable.jsx index ac189b32..e165c62c 100644 --- a/frontend/src/components/tables/StreamsTable.jsx +++ b/frontend/src/components/tables/StreamsTable.jsx @@ -51,6 +51,7 @@ import { NumberInput, Radio, LoadingOverlay, + Pill, } from '@mantine/core'; import { useNavigate } from 'react-router-dom'; import useSettingsStore from '../../store/settings'; @@ -871,52 +872,48 @@ const StreamsTable = ({ onReady }) => { ? filters.channel_group.split(',').filter(Boolean) : []; return ( - { - const index = selectedGroups.indexOf(value); - if (index === 0) { - return ( - - - {value} - - {selectedGroups.length > 1 && ( - - +{selectedGroups.length - 1} - + + {selectedGroups.length > 0 && ( + + {selectedGroups.slice(0, 10).map((group, idx) => ( +
{group}
+ ))} + {selectedGroups.length > 10 && ( +
+ +{selectedGroups.length - 10} more +
)} -
- ); - } - return null; - }} - style={{ width: '100%' }} - /> + + } + position="top" + withArrow + > + + {selectedGroups[0]} + {selectedGroups.length > 1 && ( + +{selectedGroups.length - 1} + )} + + + )} + + ); } @@ -924,66 +921,64 @@ const StreamsTable = ({ onReady }) => { const selectedM3Us = filters.m3u_account ? filters.m3u_account.split(',').filter(Boolean) : []; + const firstLabel = selectedM3Us.length > 0 + ? (m3uOptions.find((opt) => opt.value === selectedM3Us[0])?.label || selectedM3Us[0]) + : null; return ( - { - const index = selectedM3Us.indexOf(value); - if (index === 0) { - const label = - m3uOptions.find((opt) => opt.value === value)?.label || - value; - return ( - - - {label} - - {selectedM3Us.length > 1 && ( - - +{selectedM3Us.length - 1} - + + {selectedM3Us.length > 0 && ( + + {selectedM3Us.slice(0, 10).map((val, idx) => ( +
+ {m3uOptions.find((opt) => opt.value === val)?.label || val} +
+ ))} + {selectedM3Us.length > 10 && ( +
+ +{selectedM3Us.length - 10} more +
)} -
- ); - } - return null; - }} - style={{ flex: 1, minWidth: 0 }} - rightSectionPointerEvents="auto" - rightSection={React.createElement(sortingIcon, { - onClick: (e) => { - e.stopPropagation(); - onSortingChange('m3u'); - }, - size: 14, - style: { cursor: 'pointer' }, - })} - /> + + } + position="top" + withArrow + > + + {firstLabel} + {selectedM3Us.length > 1 && ( + +{selectedM3Us.length - 1} + )} + + + )} + { + e.stopPropagation(); + onSortingChange('m3u'); + }, + size: 14, + style: { cursor: 'pointer' }, + })} + /> +
); }