diff --git a/src/components/weather/WeatherCard.tsx b/src/components/weather/WeatherCard.tsx
index 134d86d..630fd53 100644
--- a/src/components/weather/WeatherCard.tsx
+++ b/src/components/weather/WeatherCard.tsx
@@ -5,7 +5,7 @@ import { createOrUpdateWeatherEntry } from '@/actions/weather';
import { Avatar } from '@/components/ui/Avatar';
import { Textarea } from '@/components/ui/Textarea';
import { Select } from '@/components/ui/Select';
-import { WEATHER_EMOJIS } from '@/lib/weather-utils';
+import { WEATHER_EMOJIS, getEmojiEvolution } from '@/lib/weather-utils';
interface WeatherEntry {
id: string;
@@ -37,6 +37,25 @@ interface WeatherCardProps {
previousEntry?: PreviousEntry | null;
}
+function EvolutionIndicator({
+ current,
+ previous,
+}: {
+ current: string | null;
+ previous: string | null | undefined;
+}) {
+ const direction = getEmojiEvolution(current, previous);
+ if (direction === null) return null;
+
+ if (direction === 'up') {
+ return ↑;
+ }
+ if (direction === 'down') {
+ return ↓;
+ }
+ return →;
+}
+
export function WeatherCard({ sessionId, currentUserId, entry, canEdit, previousEntry }: WeatherCardProps) {
const [isPending, startTransition] = useTransition();
const [notes, setNotes] = useState(entry.notes || '');
@@ -112,9 +131,6 @@ export function WeatherCard({ sessionId, currentUserId, entry, canEdit, previous
// For now, we'll use a placeholder - in real app, you'd pass user info as prop
const user = entry.user;
- // previousEntry is available for future use in Task 6
- void previousEntry;
-
return (
{/* User column */}
@@ -130,64 +146,88 @@ export function WeatherCard({ sessionId, currentUserId, entry, canEdit, previous
{/* Performance */}
|
{canEditThis ? (
- |
{/* Moral */}
{canEditThis ? (
- handleEmojiChange('moral', e.target.value || null)}
- options={WEATHER_EMOJIS.map(({ emoji }) => ({ value: emoji, label: emoji }))}
- size="sm"
- wrapperClassName="!w-fit mx-auto"
- className="!w-16 min-w-16 text-center text-lg py-2.5"
- />
+
+ handleEmojiChange('moral', e.target.value || null)}
+ options={WEATHER_EMOJIS.map(({ emoji }) => ({ value: emoji, label: emoji }))}
+ size="sm"
+ wrapperClassName="!w-fit mx-auto"
+ className="!w-16 min-w-16 text-center text-lg py-2.5"
+ />
+
+
) : (
- {moralEmoji || '-'}
+
+ {moralEmoji || '-'}
+
+
)}
|
{/* Flux */}
{canEditThis ? (
- handleEmojiChange('flux', e.target.value || null)}
- options={WEATHER_EMOJIS.map(({ emoji }) => ({ value: emoji, label: emoji }))}
- size="sm"
- wrapperClassName="!w-fit mx-auto"
- className="!w-16 min-w-16 text-center text-lg py-2.5"
- />
+
+ handleEmojiChange('flux', e.target.value || null)}
+ options={WEATHER_EMOJIS.map(({ emoji }) => ({ value: emoji, label: emoji }))}
+ size="sm"
+ wrapperClassName="!w-fit mx-auto"
+ className="!w-16 min-w-16 text-center text-lg py-2.5"
+ />
+
+
) : (
- {fluxEmoji || '-'}
+
)}
|
{/* Création de valeur */}
{canEditThis ? (
- handleEmojiChange('valueCreation', e.target.value || null)}
- options={WEATHER_EMOJIS.map(({ emoji }) => ({ value: emoji, label: emoji }))}
- size="sm"
- wrapperClassName="!w-fit mx-auto"
- className="!w-16 min-w-16 text-center text-lg py-2.5"
- />
+
+ handleEmojiChange('valueCreation', e.target.value || null)}
+ options={WEATHER_EMOJIS.map(({ emoji }) => ({ value: emoji, label: emoji }))}
+ size="sm"
+ wrapperClassName="!w-fit mx-auto"
+ className="!w-16 min-w-16 text-center text-lg py-2.5"
+ />
+
+
) : (
- {valueCreationEmoji || '-'}
+
+ {valueCreationEmoji || '-'}
+
+
)}
|