managarten/apps-archived/moodlit/apps/mobile/components/MoodCard.tsx
Till JS de6af126d6 feat(calendar): integrate NL parser into QuickEventOverlay
Wire up event-parser and event-estimator into the QuickEventOverlay
title input. Typing natural language like "Meeting morgen 14 Uhr 1h
@Arbeit" now shows a live parse preview, duration estimation from
history, and conflict warnings. On submit, parsed values auto-fill
form fields (date, time, calendar, location, recurrence, all-day).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 10:40:24 +02:00

74 lines
1.8 KiB
TypeScript

import { LinearGradient } from 'expo-linear-gradient';
import React from 'react';
import { Text, Pressable, View, StyleSheet } from 'react-native';
import type { Mood } from '@/store/store';
interface MoodCardProps {
mood: Mood;
onPress: () => void;
onFavoritePress?: () => void;
onLongPress?: () => void;
isActive?: boolean;
}
export const MoodCard = ({
mood,
onPress,
onFavoritePress,
onLongPress,
isActive,
}: MoodCardProps) => {
// Check if mood has light colors (for text color adjustment)
const isLightMood = mood.name === 'Licht';
const textColor = isLightMood ? 'text-gray-900' : 'text-white';
const badgeBg = isLightMood ? 'bg-gray-900/20' : 'bg-white/20';
const badgeText = isLightMood ? 'text-gray-900/90' : 'text-white/90';
return (
<Pressable
onPress={onPress}
onLongPress={onLongPress}
className="mx-2 mb-6"
disabled={isActive}
>
<View
className="overflow-hidden rounded-3xl shadow-lg"
style={[styles.card, isActive && styles.activeCard]}
>
<LinearGradient
colors={mood.colors}
start={{ x: 0, y: 0 }}
end={{ x: 1, y: 1 }}
style={styles.gradient}
>
{/* Mood Info */}
<View className="absolute bottom-4 left-5 right-5">
<Text className={`${textColor} mb-1 text-3xl font-bold tracking-tight`}>
{mood.name}
</Text>
{mood.isCustom && (
<View className={`${badgeBg} mt-1 self-start rounded-full px-3 py-1`}>
<Text className={`${badgeText} text-xs font-medium`}>Benutzerdefiniert</Text>
</View>
)}
</View>
</LinearGradient>
</View>
</Pressable>
);
};
const styles = StyleSheet.create({
card: {
aspectRatio: 16 / 9,
},
gradient: {
width: '100%',
height: '100%',
},
activeCard: {
opacity: 0.8,
transform: [{ scale: 1.05 }],
},
});