diff --git a/web/src/components/BotManager.tsx b/web/src/components/BotManager.tsx index bd9ea93..5e6a787 100644 --- a/web/src/components/BotManager.tsx +++ b/web/src/components/BotManager.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; import { useBotStore, type Bot } from '../stores/bot.ts'; import { useServerStore } from '../stores/server.ts'; +import { useChannelStore } from '../stores/channel.ts'; // ponytail: config fields per bot type, add new types here const BOT_TYPE_CONFIGS: Record = { @@ -27,12 +28,15 @@ export function BotManager() { const servers = useServerStore((s) => s.servers); const fetchServers = useServerStore((s) => s.fetchServers); + const channelsByServer = useChannelStore((s) => s.channelsByServer); + const fetchChannels = useChannelStore((s) => s.fetchChannels); const [showCreate, setShowCreate] = useState(false); const [createName, setCreateName] = useState(''); const [createDesc, setCreateDesc] = useState(''); const [createType, setCreateType] = useState(''); const [createConfig, setCreateConfig] = useState>({}); + const [channelServerId, setChannelServerId] = useState(''); const [editingId, setEditingId] = useState(null); const [editName, setEditName] = useState(''); const [editDesc, setEditDesc] = useState(''); @@ -63,6 +67,7 @@ export function BotManager() { setCreateDesc(''); setCreateType(''); setCreateConfig({}); + setChannelServerId(''); setShowCreate(false); } catch { // error handled in store @@ -221,13 +226,35 @@ export function BotManager() {
{field.type === 'channel' ? ( - setCreateConfig((prev) => ({ ...prev, [field.key]: e.target.value }))} - placeholder="channel ID (from URL)" - className="terminal-input w-full" - /> +
+ + +
) : (