'use client'; import { useState } from 'react'; import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@/components/ui/dialog'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Textarea } from '@/components/ui/textarea'; interface Habit { id: string; name: string; unit: string | null; moodTracking: boolean; } interface HabitCompletionDialogProps { open: boolean; onOpenChange: (open: boolean) => void; habit: Habit; onComplete: (value: number, mood?: number, notes?: string) => void; } const moodEmojis = [ { value: 1, emoji: '😞', label: 'Bad' }, { value: 2, emoji: '😐', label: 'Okay' }, { value: 3, emoji: '🙂', label: 'Good' }, { value: 4, emoji: '😊', label: 'Great' }, { value: 5, emoji: '🤩', label: 'Amazing' }, ]; export function HabitCompletionDialog({ open, onOpenChange, habit, onComplete, }: HabitCompletionDialogProps) { const [value, setValue] = useState('1'); const [mood, setMood] = useState(null); const [notes, setNotes] = useState(''); return ( Log "{habit.name}" Record your progress for today.
{habit.unit && (
setValue(e.target.value)} />
)} {habit.moodTracking && (
{moodEmojis.map((m) => ( ))}
)}