import React, { useState } from 'react'; import { Box, Typography, Button, CircularProgress, Alert, TextField } from '@mui/material'; interface SeleccionaReporteProps { onGenerarReporte: (params: { fechaDesde: string, fechaHasta: string }) => Promise; isLoading?: boolean; apiErrorMessage?: string | null; } const SeleccionaReporteDistribucionSuscripciones: React.FC = ({ onGenerarReporte, isLoading, apiErrorMessage }) => { const [fechaDesde, setFechaDesde] = useState(new Date().toISOString().split('T')[0]); const [fechaHasta, setFechaHasta] = useState(new Date().toISOString().split('T')[0]); const handleGenerar = () => { onGenerarReporte({ fechaDesde, fechaHasta }); }; return ( Reporte de Distribución de Suscripciones Seleccione un rango de fechas para generar el listado de suscriptores activos y sus detalles de entrega. setFechaDesde(e.target.value)} InputLabelProps={{ shrink: true }} disabled={isLoading} /> setFechaHasta(e.target.value)} InputLabelProps={{ shrink: true }} disabled={isLoading} /> {apiErrorMessage && {apiErrorMessage}} ); }; export default SeleccionaReporteDistribucionSuscripciones;