diff --git a/k-tv-frontend/app/(main)/dashboard/components/channel-card.tsx b/k-tv-frontend/app/(main)/dashboard/components/channel-card.tsx index 3f9adb3..821e9f8 100644 --- a/k-tv-frontend/app/(main)/dashboard/components/channel-card.tsx +++ b/k-tv-frontend/app/(main)/dashboard/components/channel-card.tsx @@ -11,6 +11,7 @@ import { Download, ChevronUp, ChevronDown, + History, } from "lucide-react"; import { Button } from "@/components/ui/button"; import { useActiveSchedule } from "@/hooks/use-channels"; @@ -29,6 +30,7 @@ interface ChannelCardProps { onExport: () => void; onMoveUp: () => void; onMoveDown: () => void; + onScheduleHistory: () => void; } function useScheduleStatus(channelId: string) { @@ -69,6 +71,7 @@ export function ChannelCard({ onExport, onMoveUp, onMoveDown, + onScheduleHistory, }: ChannelCardProps) { const [confirmOpen, setConfirmOpen] = useState(false); const blockCount = Object.values(channel.schedule_config.day_blocks).reduce( @@ -185,6 +188,15 @@ export function ChannelCard({ > + + + + ) : ( + + ) + )} + + ))} + {(entries ?? []).length === 0 && ( +

+ No schedule history yet. Generate a schedule to get started. +

+ )} + + + + ) +} diff --git a/k-tv-frontend/app/(main)/dashboard/page.tsx b/k-tv-frontend/app/(main)/dashboard/page.tsx index 4560e0b..a6abd5e 100644 --- a/k-tv-frontend/app/(main)/dashboard/page.tsx +++ b/k-tv-frontend/app/(main)/dashboard/page.tsx @@ -28,6 +28,7 @@ import { } from "./components/import-channel-dialog"; import { IptvExportDialog } from "./components/iptv-export-dialog"; import { TranscodeSettingsDialog } from "./components/transcode-settings-dialog"; +import { ScheduleHistoryDialog } from "./components/schedule-history-dialog"; import type { ChannelResponse, ProgrammingBlock, @@ -59,6 +60,7 @@ export default function DashboardPage() { const [editChannel, setEditChannel] = useState(null); const [deleteTarget, setDeleteTarget] = useState(null); const [scheduleChannel, setScheduleChannel] = useState(null); + const [scheduleHistoryChannelId, setScheduleHistoryChannelId] = useState(null); const handleCreate = (data: { name: string; @@ -186,6 +188,7 @@ export default function DashboardPage() { onExport={() => exportChannel(channel)} onMoveUp={() => handleMoveUp(channel.id)} onMoveDown={() => handleMoveDown(channel.id)} + onScheduleHistory={() => setScheduleHistoryChannelId(channel.id)} /> ))} @@ -246,6 +249,14 @@ export default function DashboardPage() { }} /> + {scheduleHistoryChannelId && ( + !open && setScheduleHistoryChannelId(null)} + /> + )} + {deleteTarget && (