import React, { useState } from 'react'; import { Calendar } from 'lucide-react'; import { cn } from '../lib/utils'; interface DateFilterPopoverProps { selectedRange: { start: string; end: string }; onRangeChange: (range: { start: string; end: string }) => void; onClose: () => void; } export function DateFilterPopover({ selectedRange, onRangeChange, onClose }: DateFilterPopoverProps) { const [startDate, setStartDate] = useState(selectedRange.start); const [endDate, setEndDate] = useState(selectedRange.end); const handleApply = () => { onRangeChange({ start: startDate, end: endDate }); onClose(); }; const handleClear = () => { setStartDate(''); setEndDate(''); onRangeChange({ start: '', end: '' }); onClose(); }; const hasValue = startDate || endDate; return (
e.stopPropagation()} >
Filter by Date Range
setStartDate(e.target.value)} className="w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-xs text-white focus:outline-none focus:border-blue-500" />
setEndDate(e.target.value)} className="w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-xs text-white focus:outline-none focus:border-blue-500" />
); }