'use client'; import { useState } from 'react'; import { Star } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@/components/ui/dialog'; import { Textarea } from '@/components/ui/textarea'; import { Label } from '@/components/ui/label'; import { cn } from '@/lib/utils'; interface CompletionDialogProps { open: boolean; onOpenChange: (open: boolean) => void; sessionType: string; topicName?: string; onComplete: (rating: number, notes: string) => void; isLoading?: boolean; } export function CompletionDialog({ open, onOpenChange, sessionType, topicName, onComplete, isLoading, }: CompletionDialogProps) { const [rating, setRating] = useState(0); const [hoveredRating, setHoveredRating] = useState(0); const [notes, setNotes] = useState(''); const handleComplete = () => { onComplete(rating || 3, notes); // Reset for next time setRating(0); setNotes(''); }; const displayRating = hoveredRating || rating; return ( 🎉 Session Complete! {topicName ? ( <>You finished a {sessionType} session on {topicName}. ) : ( <>You finished a {sessionType} session. )}
{/* Star Rating */}
{[1, 2, 3, 4, 5].map((star) => ( ))}

{displayRating === 1 && 'Struggled a lot 😓'} {displayRating === 2 && 'Found it challenging 🤔'} {displayRating === 3 && 'Did okay 👍'} {displayRating === 4 && 'Went well! 😊'} {displayRating === 5 && 'Crushed it! 🔥'} {displayRating === 0 && 'Click to rate'}

{/* Notes */}