import React, { useCallback } from 'react' import type { ChannelEntry } from '../bootstrap/state.js' import { Box, Text, Dialog } from '@anthropic/ink' import { gracefulShutdownSync } from '../utils/gracefulShutdown.js' import { Select } from './CustomSelect/index.js' type Props = { channels: ChannelEntry[] onAccept(): void } export function DevChannelsDialog({ channels, onAccept, }: Props): React.ReactNode { function onChange(value: 'accept' | 'exit') { switch (value) { case 'accept': onAccept() break case 'exit': gracefulShutdownSync(1) break } } const handleEscape = useCallback(() => { gracefulShutdownSync(0) }, []) return ( --dangerously-load-development-channels is for local channel development only. Do not use this option to run channels you have downloaded off the internet. Please use --channels to run a list of approved channels. Channels:{' '} {channels .map(c => c.kind === 'plugin' ? `plugin:${c.name}@${c.marketplace}` : `server:${c.name}`, ) .join(', ')}