feat(wallets): implement wallet movements feature with filtering and pagination
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
PencilLine,
|
||||
Star,
|
||||
} from "lucide-react";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Tooltip,
|
||||
@@ -19,7 +20,6 @@ import { useSetDefaultWallet } from "@/lib/queries";
|
||||
import { DepositDialog } from "./DepositDialog";
|
||||
import { AdjustBalanceDialog } from "./AdjustBalanceDialog";
|
||||
import { TransferDialog } from "./TransferDialog";
|
||||
import { WalletMovementsDialog } from "./WalletMovementsDialog";
|
||||
import { EditWalletDialog } from "./EditWalletDialog";
|
||||
|
||||
const balanceFormatter = new Intl.NumberFormat("es-AR", {
|
||||
@@ -32,11 +32,11 @@ interface WalletCardProps {
|
||||
}
|
||||
|
||||
export function WalletCard({ wallet }: WalletCardProps) {
|
||||
const navigate = useNavigate();
|
||||
const setDefaultWallet = useSetDefaultWallet();
|
||||
const [depositOpen, setDepositOpen] = useState(false);
|
||||
const [adjustOpen, setAdjustOpen] = useState(false);
|
||||
const [transferOpen, setTransferOpen] = useState(false);
|
||||
const [movementsOpen, setMovementsOpen] = useState(false);
|
||||
const [editOpen, setEditOpen] = useState(false);
|
||||
|
||||
return (
|
||||
@@ -147,7 +147,9 @@ export function WalletCard({ wallet }: WalletCardProps) {
|
||||
variant="outline"
|
||||
size="icon"
|
||||
className="size-8"
|
||||
onClick={() => setMovementsOpen(true)}
|
||||
onClick={() =>
|
||||
navigate({ to: "/wallets/movements", search: { walletId: wallet.id } })
|
||||
}
|
||||
>
|
||||
<History className="size-4" />
|
||||
</Button>
|
||||
@@ -173,11 +175,6 @@ export function WalletCard({ wallet }: WalletCardProps) {
|
||||
open={transferOpen}
|
||||
onOpenChange={setTransferOpen}
|
||||
/>
|
||||
<WalletMovementsDialog
|
||||
wallet={wallet}
|
||||
open={movementsOpen}
|
||||
onOpenChange={setMovementsOpen}
|
||||
/>
|
||||
<EditWalletDialog
|
||||
wallet={wallet}
|
||||
open={editOpen}
|
||||
|
||||
Reference in New Issue
Block a user