"use client"; import React, { useState } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { FileText, Download, Eye, Search, Filter, CreditCard, CheckCircle2, Clock, AlertCircle, TrendingUp, Receipt, User, Calendar, DollarSign } from "lucide-react"; const mockInvoices = [ { id: "INV-2023-001", customer: "Nexus Corp", date: "2023-11-15", amount: 15420.50, status: "paid", items: [ { description: "Soporte Técnico Enterprise", qty: 1, price: 5000 }, { description: "Licencia Anual ERP Nexus", qty: 1, price: 8000 }, { description: "Implementación Cloud", qty: 1, price: 2420.50 } ] }, { id: "INV-2023-002", customer: "Global Tech Solutions", date: "2023-11-18", amount: 4200.00, status: "pending", items: [ { description: "Consultoría IT", qty: 10, price: 420 } ] }, { id: "INV-2023-003", customer: "Alina Systems", date: "2023-11-20", amount: 1250.75, status: "overdue", items: [ { description: "Mantenimiento Preventivo", qty: 5, price: 250.15 } ] }, ]; export default function BillingPage() { const [selectedInvoice, setSelectedInvoice] = useState(null); return (

FACTURACIÓN / BILLING

Gestión de Ingresos y Comprobantes Fiscales

{/* Stats Quick View */}
} /> } /> } />
{/* Invoice List */}

Historial de Facturas

{mockInvoices.map((inv) => ( setSelectedInvoice(inv)} className={`flex items-center justify-between p-4 rounded-2xl border border-white/5 cursor-pointer transition-all ${selectedInvoice?.id === inv.id ? 'bg-white/10 border-blue-500/50 shadow-lg' : 'hover:border-white/10'}`} >

{inv.id}

{inv.customer}

${inv.amount.toLocaleString()}

{inv.date}

))}
{/* Invoice Detail Breakdown */}
{selectedInvoice ? ( {/* Decorative Elements */}

INVOICE

{selectedInvoice.id}

N

Cliente

{selectedInvoice.customer}

Fecha

{selectedInvoice.date}

{/* Items Table */}

Desglose de Servicios

{selectedInvoice.items.map((item: any, idx: number) => (
{item.description} Cant: {item.qty} x ${item.price.toLocaleString()}
${(item.qty * item.price).toLocaleString()}
))}
{/* Calculations */}
Subtotal ${(selectedInvoice.amount * 0.84).toLocaleString()}
IVA (16%) ${(selectedInvoice.amount * 0.16).toLocaleString()}
Total Neto ${selectedInvoice.amount.toLocaleString()}
) : (

Seleccione una factura

Haga clic en una factura de la lista para ver el desglose detallado para el cliente.

)}
{/* Payment Methods Footer */}
Gateways Activos
Pagos Automáticos Liquidación Instantánea
); } function StatWidget({ label, value, icon }: any) { return (

{label}

{value}

{icon}
); } function StatusBadge({ status }: { status: "paid" | "pending" | "overdue" | string }) { const styles: Record = { paid: { bg: "bg-emerald-500/10", text: "text-emerald-400", label: "Pagado", icon: }, pending: { bg: "bg-orange-500/10", text: "text-orange-400", label: "Pendiente", icon: }, overdue: { bg: "bg-red-500/10", text: "text-red-400", label: "Vencido", icon: }, }; const style = styles[status] || { bg: "bg-gray-500/10", text: "text-gray-400", label: "Desconocido", icon: null }; return (
{style.icon} {style.label}
); }