feat: add import functionality for channel configurations and export option for channels

This commit is contained in:
2026-03-11 21:37:18 +01:00
parent 8cc3439d2e
commit 37167fc19c
3 changed files with 350 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
import Link from "next/link";
import { Pencil, Trash2, RefreshCw, Tv2, CalendarDays } from "lucide-react";
import { Pencil, Trash2, RefreshCw, Tv2, CalendarDays, Download } from "lucide-react";
import { Button } from "@/components/ui/button";
import type { ChannelResponse } from "@/lib/types";
@@ -10,6 +10,7 @@ interface ChannelCardProps {
onDelete: () => void;
onGenerateSchedule: () => void;
onViewSchedule: () => void;
onExport: () => void;
}
export function ChannelCard({
@@ -19,6 +20,7 @@ export function ChannelCard({
onDelete,
onGenerateSchedule,
onViewSchedule,
onExport,
}: ChannelCardProps) {
const blockCount = channel.schedule_config.blocks.length;
@@ -38,6 +40,15 @@ export function ChannelCard({
</div>
<div className="flex shrink-0 items-center gap-1">
<Button
variant="ghost"
size="icon-sm"
onClick={onExport}
title="Export as JSON"
className="text-zinc-600 hover:text-zinc-200"
>
<Download className="size-3.5" />
</Button>
<Button
variant="ghost"
size="icon-sm"