Update date-picker.tsx

This commit is contained in:
g
2025-11-28 18:33:23 +00:00
parent b10b2f2701
commit 4e5fc1901c

View File

@@ -126,17 +126,15 @@ export function MonthPicker({ selectedMonth, onMonthChange, placeholder = "Pick
<CalendarIcon className="mr-2 h-4 w-4" /> <CalendarIcon className="mr-2 h-4 w-4" />
{formatSelectedMonth(selectedMonth)} {formatSelectedMonth(selectedMonth)}
{selectedMonth && ( {selectedMonth && (
<Button <div
variant="ghost" className="ml-auto h-6 w-6 p-0 flex items-center justify-center rounded-sm hover:bg-accent cursor-pointer"
size="sm"
className="ml-auto h-6 w-6 p-0 hover:bg-transparent"
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
onMonthChange?.(undefined) onMonthChange?.(undefined)
}} }}
> >
<X className="h-3 w-3" /> <X className="h-3 w-3" />
</Button> </div>
)} )}
</Button> </Button>
</PopoverTrigger> </PopoverTrigger>
@@ -272,17 +270,15 @@ export function DateRangePicker({
<CalendarIcon className="mr-2 h-4 w-4" /> <CalendarIcon className="mr-2 h-4 w-4" />
{formatDateRange(dateRange)} {formatDateRange(dateRange)}
{dateRange?.from && ( {dateRange?.from && (
<Button <div
variant="ghost" className="ml-auto h-6 w-6 p-0 flex items-center justify-center rounded-sm hover:bg-accent cursor-pointer"
size="sm"
className="ml-auto h-6 w-6 p-0 hover:bg-transparent"
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
handleClear() handleClear()
}} }}
> >
<X className="h-3 w-3" /> <X className="h-3 w-3" />
</Button> </div>
)} )}
</Button> </Button>
</PopoverTrigger> </PopoverTrigger>