/** * Channels Page * Manage messaging channel connections */ import { useEffect } from 'react'; import { Plus, Radio, RefreshCw, Settings } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { useChannelsStore } from '@/stores/channels'; import { StatusBadge } from '@/components/common/StatusBadge'; import { LoadingSpinner } from '@/components/common/LoadingSpinner'; import { CHANNEL_ICONS, CHANNEL_NAMES, type ChannelType } from '@/types/channel'; export function Channels() { const { channels, loading, error, fetchChannels, connectChannel, disconnectChannel } = useChannelsStore(); // Fetch channels on mount useEffect(() => { fetchChannels(); }, [fetchChannels]); // Supported channel types for adding const supportedTypes: ChannelType[] = ['whatsapp', 'telegram', 'discord', 'slack']; if (loading) { return (
Connect and manage your messaging channels
Connect a messaging channel to start using ClawX
Last activity: {new Date(channel.lastActivity).toLocaleString()}
)} {channel.error && ({channel.error}
)}