feat: support save live channel to favorite

This commit is contained in:
shinya
2025-08-26 16:36:44 +08:00
parent fa46e05c7c
commit 15b20603b8
12 changed files with 434 additions and 49 deletions
+7 -2
View File
@@ -1,4 +1,4 @@
import { X } from 'lucide-react';
import { Radio, X } from 'lucide-react';
import Image from 'next/image';
import React, { useEffect, useState } from 'react';
@@ -22,6 +22,7 @@ interface MobileActionSheetProps {
sourceName?: string; // 播放源名称
currentEpisode?: number; // 当前集数
totalEpisodes?: number; // 总集数
origin?: 'vod' | 'live';
}
const MobileActionSheet: React.FC<MobileActionSheetProps> = ({
@@ -35,6 +36,7 @@ const MobileActionSheet: React.FC<MobileActionSheetProps> = ({
sourceName,
currentEpisode,
totalEpisodes,
origin = 'vod',
}) => {
const [isVisible, setIsVisible] = useState(false);
const [isAnimating, setIsAnimating] = useState(false);
@@ -217,7 +219,7 @@ const MobileActionSheet: React.FC<MobileActionSheetProps> = ({
src={poster}
alt={title}
fill
className="object-cover"
className={origin === 'live' ? 'object-contain' : 'object-cover'}
loading="lazy"
/>
</div>
@@ -229,6 +231,9 @@ const MobileActionSheet: React.FC<MobileActionSheetProps> = ({
</h3>
{sourceName && (
<span className="flex-shrink-0 text-xs px-2 py-1 border border-gray-300 dark:border-gray-600 rounded text-gray-600 dark:text-gray-400 bg-gray-50 dark:bg-gray-800">
{origin === 'live' && (
<Radio size={12} className="inline-block text-gray-500 dark:text-gray-400 mr-1.5" />
)}
{sourceName}
</span>
)}