"use client" import { useState } from "react" const CHANNELS = [ { key: "telegram", label: "Telegram", icon: "/icons/telegram.svg", color: "blue", switchOn: "bg-blue-600" }, { key: "gotify", label: "Gotify", icon: "/icons/gotify.svg", color: "green", switchOn: "bg-green-600" }, { key: "discord", label: "Discord", icon: "/icons/discord.svg", color: "indigo", switchOn: "bg-indigo-600" }, { key: "email", label: "Email", icon: "/icons/mail.svg", color: "amber", switchOn: "bg-amber-600" }, ] const SELECTED_BORDER = { blue: "border-blue-500/60 bg-blue-500/10", green: "border-green-500/60 bg-green-500/10", indigo: "border-indigo-500/60 bg-indigo-500/10", amber: "border-amber-500/60 bg-amber-500/10", } interface ChannelGridProps { enabledChannels: { telegram: boolean; gotify: boolean; discord: boolean; email: boolean } onToggle: (channel: string, enabled: boolean) => void selectedChannel: string | null onSelect: (channel: string | null) => void } export function ChannelGrid({ enabledChannels, onToggle, selectedChannel, onSelect }: ChannelGridProps) { return (
{CHANNELS.map(ch => { const isEnabled = enabledChannels[ch.key as keyof typeof enabledChannels] || false const isSelected = selectedChannel === ch.key const selStyle = SELECTED_BORDER[ch.color as keyof typeof SELECTED_BORDER] return ( ) })}
) }