// Copyright 2026 Arctel.net // SPDX-License-Identifier: Apache-2.0 'use client'; import * as React from 'react'; import { useTranslations } from 'next-intl'; import { Loader2, Trash2 } from 'lucide-react'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { Switch } from '@/components/ui/switch'; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '@/components/ui/alert-dialog'; import type { MessageChannel } from '@/lib/services/message-gateway'; interface ChannelCardProps { channel: MessageChannel; onToggle: (enabled: boolean) => void; onDelete: () => void; toggling?: boolean; deleting?: boolean; } export function ChannelCard({ channel, onToggle, onDelete, toggling, deleting, }: ChannelCardProps) { const t = useTranslations('admin.messageGateway'); const [confirmOpen, setConfirmOpen] = React.useState(false); const typeLabel = channel.type === 'qq' ? t('typeQQ') : t('typeTelegram'); return (