Import apps/android/src/screens/bot/reference-chat-modal.tsx
This commit is contained in:
parent
ddfdeda7be
commit
4e49db2c19
|
|
@ -1,7 +1,7 @@
|
||||||
import { useEffect, useMemo, useState } from 'react'
|
import { useEffect, useMemo, useState } from 'react'
|
||||||
import { Modal, Pressable, ScrollView, StyleSheet, Text, TextInput, View } from 'react-native'
|
import { Modal, Pressable, ScrollView, StyleSheet, Text, TextInput, View } from 'react-native'
|
||||||
import * as Haptics from 'expo-haptics'
|
import * as Haptics from 'expo-haptics'
|
||||||
import { CalendarDays, MessageSquare, Search, X } from 'lucide-react-native'
|
import { CalendarDays, MessageSquare, Search, X, Zap } from 'lucide-react-native'
|
||||||
import { strings } from '../../locales/i18n'
|
import { strings } from '../../locales/i18n'
|
||||||
import type { BotState } from '../../services/bot-catalog'
|
import type { BotState } from '../../services/bot-catalog'
|
||||||
import { useAppStore } from '../../state/store'
|
import { useAppStore } from '../../state/store'
|
||||||
|
|
@ -21,11 +21,13 @@ export function BotPlusMenuModal({
|
||||||
visible,
|
visible,
|
||||||
onClose,
|
onClose,
|
||||||
onReferenceChat,
|
onReferenceChat,
|
||||||
|
onOpenPrompts,
|
||||||
onOpenSchedules,
|
onOpenSchedules,
|
||||||
}: {
|
}: {
|
||||||
visible: boolean
|
visible: boolean
|
||||||
onClose: () => void
|
onClose: () => void
|
||||||
onReferenceChat: () => void
|
onReferenceChat: () => void
|
||||||
|
onOpenPrompts?: () => void
|
||||||
onOpenSchedules?: () => void
|
onOpenSchedules?: () => void
|
||||||
}) {
|
}) {
|
||||||
const styles = useThemedStyles(createStyles)
|
const styles = useThemedStyles(createStyles)
|
||||||
|
|
@ -41,13 +43,23 @@ export function BotPlusMenuModal({
|
||||||
<GroupRow
|
<GroupRow
|
||||||
first
|
first
|
||||||
icon={MessageSquare}
|
icon={MessageSquare}
|
||||||
label="引用对话"
|
label={strings.chat.referenceChat}
|
||||||
detail="将其他 Bot 对话或 DSH 会话作为上下文"
|
detail={strings.chat.referenceChatDetail}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
onClose()
|
onClose()
|
||||||
onReferenceChat()
|
onReferenceChat()
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
{onOpenPrompts !== undefined && (
|
||||||
|
<GroupRow
|
||||||
|
icon={Zap}
|
||||||
|
label={strings.chat.quickPrompts}
|
||||||
|
onPress={() => {
|
||||||
|
onClose()
|
||||||
|
onOpenPrompts()
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{onOpenSchedules !== undefined && (
|
{onOpenSchedules !== undefined && (
|
||||||
<GroupRow
|
<GroupRow
|
||||||
icon={CalendarDays}
|
icon={CalendarDays}
|
||||||
|
|
@ -130,8 +142,8 @@ export function ReferenceChatModal({
|
||||||
<ModalSurface onClose={onClose}>
|
<ModalSurface onClose={onClose}>
|
||||||
<View style={styles.header}>
|
<View style={styles.header}>
|
||||||
<View style={styles.grow}>
|
<View style={styles.grow}>
|
||||||
<Text style={styles.title}>引用对话</Text>
|
<Text style={styles.title}>{strings.chat.referenceChat}</Text>
|
||||||
<Text style={styles.subtitle}>选择一段其他 Bot 对话或 DSH 会话作为上下文</Text>
|
<Text style={styles.subtitle}>{strings.chat.referenceChatSubtitle}</Text>
|
||||||
</View>
|
</View>
|
||||||
<IconButton label={strings.common.close} icon={X} onPress={onClose} />
|
<IconButton label={strings.common.close} icon={X} onPress={onClose} />
|
||||||
</View>
|
</View>
|
||||||
|
|
@ -287,7 +299,7 @@ export function ReferencedChatPills({
|
||||||
<MessageSquare size={14} color={colors.primary} />
|
<MessageSquare size={14} color={colors.primary} />
|
||||||
)}
|
)}
|
||||||
<Text numberOfLines={1} style={styles.referencePillText}>
|
<Text numberOfLines={1} style={styles.referencePillText}>
|
||||||
引用:{item.mentionLabel}
|
{strings.chat.referencedChat(item.mentionLabel)}
|
||||||
</Text>
|
</Text>
|
||||||
<Pressable
|
<Pressable
|
||||||
accessibilityRole="button"
|
accessibilityRole="button"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue