import React from "react"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Calendar } from "lucide-react"; import { formatLocalDate, parseLocalDate } from "@/utils/dateUtils"; import { DateInput } from "@/components/ui/dateInput"; import { useQuery } from "@tanstack/react-query"; import { apiRequest } from "@/lib/queryClient"; export default function ReportConfig({ startDate, endDate, setStartDate, setEndDate, selectedReportType, setSelectedReportType, npiProviderId, setNpiProviderId, }) { let startDateObj = null; if (startDate) { try { startDateObj = parseLocalDate(startDate); } catch { startDateObj = null; } } let endDateObj = null; if (endDate) { try { endDateObj = parseLocalDate(endDate); } catch { endDateObj = null; } } const { data: npiProviders = [] } = useQuery({ queryKey: ["/api/npiProviders/"], queryFn: async () => { const res = await apiRequest("GET", "/api/npiProviders/"); return res.json(); }, staleTime: 60_000, }); return ( Report Configuration
Choose the report type, date range, and provider.
setStartDate(d ? formatLocalDate(d) : "")} disableFuture/>
setEndDate(d ? formatLocalDate(d) : "")} disableFuture/>
); }