'use client' import { useState } from 'react' import { useFinanzasStore } from '@/lib/store' import { X, Calendar, Zap, Droplets, Flame, Wifi } from 'lucide-react' import { cn } from '@/lib/utils' interface AddServiceModalProps { isOpen: boolean onClose: () => void } const SERVICES = [ { id: 'electricity', label: 'Luz', icon: Zap, color: 'text-yellow-400' }, { id: 'water', label: 'Agua', icon: Droplets, color: 'text-blue-400' }, { id: 'gas', label: 'Gas', icon: Flame, color: 'text-orange-400' }, { id: 'internet', label: 'Internet', icon: Wifi, color: 'text-cyan-400' }, ] export function AddServiceModal({ isOpen, onClose }: AddServiceModalProps) { const addServiceBill = useFinanzasStore((state) => state.addServiceBill) const [type, setType] = useState('electricity') const [amount, setAmount] = useState('') const [period, setPeriod] = useState(new Date().toISOString().slice(0, 7)) // YYYY-MM const [date, setDate] = useState(new Date().toISOString().split('T')[0]) if (!isOpen) return null const handleSubmit = (e: React.FormEvent) => { e.preventDefault() if (!amount) return addServiceBill({ type: type as any, amount: parseFloat(amount), date: new Date(date).toISOString(), period: period, notes: '' }) // Reset setAmount('') onClose() } return (