diff --git a/apps/android/src/screens/bot/editor.tsx b/apps/android/src/screens/bot/editor.tsx index 05ed140..b26697d 100644 --- a/apps/android/src/screens/bot/editor.tsx +++ b/apps/android/src/screens/bot/editor.tsx @@ -1,5 +1,7 @@ import { useEffect, useMemo, useState } from 'react' -import { Alert, Modal, Pressable, ScrollView, StyleSheet, Text, TextInput, View } from 'react-native' +import { Pressable, ScrollView, StyleSheet, Text, TextInput, View } from 'react-native' +import { useSafeAreaInsets } from 'react-native-safe-area-context' +import { Alert } from '../../ui/alert' import { strings as s } from '../../locales/i18n' import { canDeleteBot, object, objects, text, type BotEntry, type BotRoom, type BotState, type BotOperation, type BotObject, type BotRemoteClient } from '../../services/bot-catalog' import { ChevronDown, ChevronUp, RotateCcw, Trash2, X } from 'lucide-react-native' @@ -7,7 +9,8 @@ import { Button, IconButton } from '../../ui/components' import { radius, spacing, type } from '../../ui/theme' import { useTheme, type ThemeColors } from '../../ui/theme-context' import { useThemedStyles } from '../../ui/use-themed-styles' -import { ModalSurface } from '../chat/modal' +import { SheetModal } from '../../ui/sheet' +import { useResponsiveLayout } from '../../ui/responsive' import { Toggle } from '../../ui/toggle' import { BotAgentBadge, engineOfModel } from './agent-badge' import { BotChoice } from './controls' @@ -149,6 +152,8 @@ export function BotEditor({ kind, bot, room, state, client, busy, error, perform const styles = useThemedStyles(createBotStyles) const localStyles = useThemedStyles(createEditorStyles) const { colors } = useTheme() + const { compactHeight } = useResponsiveLayout() + const insets = useSafeAreaInsets() const editing = bot !== undefined || room !== undefined const [modelPicker, setModelPicker] = useState(false) const [name, setName] = useState(bot?.name ?? room?.name ?? '') @@ -241,10 +246,28 @@ export function BotEditor({ kind, bot, room, state, client, busy, error, perform onClose() } } - return { if (!busy) onClose() }}> - { if (!busy) onClose() }}> - {editing ? s.bots.edit : kind === 'bot' ? s.bots.newBot : s.bots.newGroup} - + const header = {editing ? s.bots.edit : kind === 'bot' ? s.bots.newBot : s.bots.newGroup} + const actions = + {canDelete &&