Toggle paid/unpaid was duplicated across the desktop and mobile rows (optimistic flip + Undo/paid toasts + refresh). Extracted into a shared useTogglePaid() React Query mutation hook: the caller keeps the instant local optimistic flip, the hook rolls it back on error and invalidates the tracker/badge caches on settle. isPending replaces the desktop row's local loading state (badge spinner + un-pay confirm dialog). With useQuickPay (P3), both core Tracker write actions are now idiomatic useMutation hooks living in one place. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| components | ||
| contexts | ||
| hooks | ||
| lib | ||
| pages | ||
| public/img | ||
| App.jsx | ||
| api.js | ||
| index.css | ||
| main.jsx | ||