@@ -1028,8 +1249,26 @@ export default function SubscriptionsPage() {
- Tracked Subscriptions
- Subscriptions are bills with recurring-service metadata.
+
+
+ Tracked Subscriptions
+ Subscriptions are bills with recurring-service metadata.
+
+
+ setSubscriptionSort('custom')}
+ >
+ Custom
+
+ setSubscriptionSort('cadence')}
+ >
+ Cadence
+
+
+
{loading ? (
@@ -1046,28 +1285,8 @@ export default function SubscriptionsPage() {
) : (
<>
- {active.map((item, index) => (
-
setModal({ bill })}
- onToggle={toggleSubscription}
- busy={busyId === `toggle-${item.id}`}
- moveControls={moveControlsForGroup(active, true)(item, index)}
- dragProps={dragPropsForGroup(active, true)(item, index)}
- />
- ))}
- {paused.map((item, index) => (
- setModal({ bill })}
- onToggle={toggleSubscription}
- busy={busyId === `toggle-${item.id}`}
- moveControls={moveControlsForGroup(paused, false)(item, index)}
- dragProps={dragPropsForGroup(paused, false)(item, index)}
- />
- ))}
+ {renderSubscriptionRows(sortedActive, true)}
+ {renderSubscriptionRows(sortedPaused, false)}
>
)}
@@ -1227,10 +1446,7 @@ export default function SubscriptionsPage() {
initialBill={modal.initialBill}
categories={categories}
onClose={() => setModal(null)}
- onSave={async () => {
- setModal(null);
- await refreshAll();
- }}
+ onSave={handleBillModalSave}
/>
)}