feat: add links to transaction pages from accounts and folders for improved navigation

This commit is contained in:
Julien Froidefond
2025-11-27 11:53:36 +01:00
parent 5eb37e631f
commit ef668510c8
3 changed files with 24 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
"use client";
import { useState, useMemo } from "react";
import { useState, useMemo, useEffect } from "react";
import { useSearchParams } from "next/navigation";
import { Sidebar } from "@/components/dashboard/sidebar";
import { useBankingData } from "@/lib/hooks";
import { Button } from "@/components/ui/button";
@@ -41,9 +42,18 @@ type SortField = "date" | "amount" | "description";
type SortOrder = "asc" | "desc";
export default function TransactionsPage() {
const searchParams = useSearchParams();
const { data, isLoading, refresh, update } = useBankingData();
const [searchQuery, setSearchQuery] = useState("");
const [selectedAccount, setSelectedAccount] = useState<string>("all");
// Initialize account filter from URL params
useEffect(() => {
const accountId = searchParams.get("accountId");
if (accountId) {
setSelectedAccount(accountId);
}
}, [searchParams]);
const [selectedCategory, setSelectedCategory] = useState<string>("all");
const [showReconciled, setShowReconciled] = useState<string>("all");
const [sortField, setSortField] = useState<SortField>("date");