Files
orca/mobile/src/session/MobileNativeChatStopButton.tsx
T

31 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { ActivityIndicator, Pressable } from 'react-native'
import { Square } from 'lucide-react-native'
import { NATIVE_CHAT_TURN_STATUS_COPY } from '../../../src/shared/native-chat-turn-status'
import { colors } from '../theme/mobile-theme'
import { mobileNativeChatComposerStyles as styles } from './native-chat/composer/mobile-native-chat-composer-styles'
// held tracks this phone’s in-flight Stop request, not the host’s stopping status.
export function MobileNativeChatStopButton({
onStop,
held
}: {
onStop?: () => void
held: boolean
}): React.JSX.Element {
return (
<Pressable
style={({ pressed }) => [styles.controlButton, pressed && styles.pressed]}
onPress={onStop}
disabled={held}
accessibilityRole="button"
accessibilityLabel={held ? NATIVE_CHAT_TURN_STATUS_COPY.stopping : 'Stop the agent'}
>
{held ? (
<ActivityIndicator size="small" color={colors.textPrimary} />
) : (
<Square size={13} color={colors.textPrimary} strokeWidth={2.4} fill={colors.textPrimary} />
)}
</Pressable>
)
}