'use client'; import React, { useState } from 'react'; import toast from 'react-hot-toast'; import { PenSquare, Calendar as CalendarIcon, HandHeart, CheckCircle2, Sparkles, Save, Loader2, ChevronDown } from 'lucide-react'; interface DailyEntryProps { date: string; onDateChange: (date: string) => void; text: string; onTextChange: (text: string) => void; prayFor: string; onPrayForChange: (prayFor: string) => void; prayForOptions?: string[]; answered?: boolean; onAnsweredChange?: (answered: boolean) => void; answerDetails?: string; onAnswerDetailsChange?: (details: string) => void; onSubmit: (e: React.FormEvent) => void; loading?: boolean; isEditing?: boolean; } export default function DailyEntry({ date, onDateChange, text, onTextChange, prayFor, onPrayForChange, prayForOptions = [], answered = false, onAnsweredChange, answerDetails = '', onAnswerDetailsChange, onSubmit, loading = false, isEditing = false, }: DailyEntryProps) { const today = new Date().toISOString().split('T')[0]; const isToday = date === today; const wordCount = text.split(/\s+/).filter(w => w).length; return (
{new Date(date).toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', })}