forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDateRangePicker.tsx
More file actions
31 lines (29 loc) · 1.28 KB
/
Copy pathDateRangePicker.tsx
File metadata and controls
31 lines (29 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import type { DateRange } from '../../types/analytics';
interface DateRangePickerProps {
value: DateRange;
onChange: (range: DateRange) => void;
}
export function DateRangePicker({ value, onChange }: DateRangePickerProps) {
return (
<div className="flex flex-wrap items-center gap-3">
<label className="flex items-center gap-2 text-sm text-gray-600">
From
<input
type="date"
value={value.dateFrom}
onChange={(e) => onChange({ ...value, dateFrom: e.target.value })}
className="border border-gray-300 rounded-lg px-3 py-1.5 text-sm text-gray-900 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none"
/>
</label>
<label className="flex items-center gap-2 text-sm text-gray-600">
To
<input
type="date"
value={value.dateTo}
onChange={(e) => onChange({ ...value, dateTo: e.target.value })}
className="border border-gray-300 rounded-lg px-3 py-1.5 text-sm text-gray-900 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none"
/>
</label>
</div>
);
}