// Chat-Bubble + Spezial-Cards (Spiele/Überwunden) für den SOS-Chat-Stream
// sowie GameHeader für die aktive Spiel-Session.
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import { type GameType, GAME_META, GamePickerGrid } from './UrgeGames';
import { RiveAvatar, type Emotion as LyraEmotion } from '../RiveAvatar';
export type CardType = 'games' | 'overcome';
export type SosMsg = { id: string; role: 'user' | 'assistant'; content: string; cardType?: CardType; timestamp: Date };
// ── GameCard ─────────────────────────────────────────────────────────────────
export function GameCard({ onSelect }: { onSelect: (game: GameType) => void }) {
return (
Welches Spiel?
);
}
// ── OvercomeCard ─────────────────────────────────────────────────────────────
export function OvercomeCard() {
return (
🎉
Gut gemacht.
Du hast den Impuls überwunden.
);
}
// ── MessageRow ───────────────────────────────────────────────────────────────
type MessageRowProps = {
item: SosMsg;
onGameSelect: (game: GameType) => void;
onBreathingDone: () => void;
onSpeak?: (text: string) => Promise | void;
};
export default function MessageRow({ item, onGameSelect }: MessageRowProps) {
const isUser = item.role === 'user';
if (item.cardType === 'games') return ;
if (item.cardType === 'overcome') return ;
return (
{item.content}
);
}
// ── GameHeader ───────────────────────────────────────────────────────────────
export function GameHeader({ game, emotion, onBack }: { game: GameType; emotion: LyraEmotion; onBack: () => void }) {
const meta = GAME_META.find((g) => g.id === game);
return (
{meta?.id ?? game}
);
}
const st = StyleSheet.create({
msgRow: { flexDirection: 'row', marginBottom: 4, alignItems: 'flex-end' },
msgRowUser: { justifyContent: 'flex-end' },
msgRowAssistant: { justifyContent: 'flex-start', marginBottom: 6 },
bubbleCol: { maxWidth: '75%', gap: 2 },
bubbleColUser: { alignItems: 'flex-end' },
bubbleColAssistant: { alignItems: 'flex-start' },
bubble: { borderRadius: 20, paddingHorizontal: 14, paddingVertical: 9 },
bubbleUser: { backgroundColor: '#007AFF', borderBottomRightRadius: 4 },
bubbleAssistant: { backgroundColor: '#f0f0f0', borderBottomLeftRadius: 4 },
bubbleText: { fontSize: 15, lineHeight: 22 },
bubbleTextUser: { color: '#ffffff', fontFamily: 'Nunito_400Regular' },
bubbleTextAssistant: { color: '#1a1a1a', fontFamily: 'Nunito_400Regular' },
gameCard: { backgroundColor: '#f0f9ff', borderRadius: 16, borderWidth: 1, borderColor: '#bae6fd', padding: 12, maxWidth: '92%' },
gameCardTitle: { fontFamily: 'Nunito_700Bold', color: '#0369a1', fontSize: 13, marginBottom: 10 },
overcomeCard: { backgroundColor: '#f0fdf4', borderRadius: 16, borderWidth: 1, borderColor: '#86efac', padding: 16, alignItems: 'center', maxWidth: '88%', gap: 4 },
overcomeTitle: { fontFamily: 'Nunito_800ExtraBold', fontSize: 18, color: '#15803d' },
overcomeSub: { fontFamily: 'Nunito_400Regular', fontSize: 13, color: '#166534', textAlign: 'center' },
gameHeader: { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 12, paddingVertical: 8, borderBottomWidth: 1, borderBottomColor: '#f3f4f6', backgroundColor: '#fff' },
backBtn: { width: 40, height: 40, borderRadius: 20, backgroundColor: '#f3f4f6', alignItems: 'center', justifyContent: 'center' },
});