fix(tracker): page update
This commit is contained in:
parent
12bcd1d8f3
commit
3f93a7dca2
|
|
@ -1,6 +1,6 @@
|
|||
import { useState, useEffect, useMemo, useCallback } from 'react';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { ChevronLeft, ChevronRight, AlertCircle, CheckCircle2, Plus, Search, RefreshCw, Landmark, ArrowUpToLine, ArrowUp, ArrowDown, BellOff, Eye, EyeOff, Settings2 } from 'lucide-react';
|
||||
import { ChevronLeft, ChevronRight, AlertCircle, CheckCircle2, Plus, Search, RefreshCw, Landmark, ArrowUpToLine, ArrowUp, ArrowDown, BellOff, EyeOff, Settings2 } from 'lucide-react';
|
||||
import { toast } from 'sonner';
|
||||
import { api } from '@/api.js';
|
||||
import { useTracker, useDriftReport } from '@/hooks/useQueries';
|
||||
|
|
@ -435,15 +435,14 @@ export default function TrackerPage() {
|
|||
}
|
||||
|
||||
function hideSearchSortPanel() {
|
||||
saveTrackerSettings({
|
||||
tracker_show_search_sort: 'false',
|
||||
}, 'Search & sort hidden.');
|
||||
saveTrackerSettings({ tracker_show_search_sort: 'false' });
|
||||
toast('Search & sort hidden.', {
|
||||
action: { label: 'Undo', onClick: () => saveTrackerSettings({ tracker_show_search_sort: 'true' }) },
|
||||
});
|
||||
}
|
||||
|
||||
function showSearchSortPanel() {
|
||||
saveTrackerSettings({
|
||||
tracker_show_search_sort: 'true',
|
||||
});
|
||||
saveTrackerSettings({ tracker_show_search_sort: 'true' });
|
||||
}
|
||||
const toggleFilter = (key) => {
|
||||
const paramMap = { autopay: 'ap', firstBucket: 'b1', fifteenthBucket: 'b2', unpaid: 'un', overdue: 'ov', debt: 'de' };
|
||||
|
|
@ -770,30 +769,6 @@ export default function TrackerPage() {
|
|||
</div>
|
||||
</SearchFilterPanel>
|
||||
)}
|
||||
{!showSearchSort && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={showSearchSortPanel}
|
||||
disabled={savingTrackerSetting}
|
||||
className="group flex w-full items-center justify-between gap-3 rounded-xl border border-dashed border-border/80 bg-card/55 px-4 py-3 text-left shadow-sm transition-colors hover:border-primary/40 hover:bg-card/85 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
||||
>
|
||||
<span className="flex min-w-0 items-center gap-3">
|
||||
<span className="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-primary/15 bg-primary/10 text-primary">
|
||||
<Search className="h-4 w-4" />
|
||||
</span>
|
||||
<span className="min-w-0">
|
||||
<span className="block text-sm font-semibold text-foreground">Show Search & sort</span>
|
||||
<span className="block truncate text-xs text-muted-foreground">
|
||||
{[searchResultLabel, hasFilters ? 'filters active' : 'no filters', searchSortLabel].filter(Boolean).join(' · ')}
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
<span className="inline-flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium text-muted-foreground transition-colors group-hover:bg-accent group-hover:text-foreground">
|
||||
<Eye className="h-3.5 w-3.5" />
|
||||
Restore
|
||||
</span>
|
||||
</button>
|
||||
)}
|
||||
|
||||
{/* ── Summary cards (backend already excludes skipped from totals) ── */}
|
||||
{showSummaryCards && loading ? (
|
||||
|
|
|
|||
Loading…
Reference in New Issue