- migrate biome.json to schema 2.5.10 (preset instead of recommended) - apply safe fixes: formatting, import organization, unused imports/vars - use node:crypto import protocol - drop unused catch bindings - a11y: associate labels with controls via htmlFor/id (add optional id to DatePicker), hide decorative SVGs from AT, and replace the custom role="checkbox" button with a native checkbox input - remove unnecessary pageSize dependency from useMemo
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import { Plus } from "lucide-react";
|
|
import { useState } from "react";
|
|
import { useWallets } from "@/lib/queries";
|
|
import { CreateWalletDialog } from "./components/CreateWalletDialog";
|
|
import { WalletCard } from "./components/WalletCard";
|
|
|
|
export function WalletsPage() {
|
|
const { data: wallets, isLoading } = useWallets();
|
|
const [createOpen, setCreateOpen] = useState(false);
|
|
|
|
return (
|
|
<div className="space-y-4">
|
|
<div className="flex items-center justify-between">
|
|
<h1 className="text-2xl font-semibold">Billeteras</h1>
|
|
<button
|
|
type="button"
|
|
onClick={() => setCreateOpen(true)}
|
|
className="inline-flex items-center gap-2 rounded-lg bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors cursor-pointer"
|
|
>
|
|
<Plus className="size-4" />
|
|
Nueva billetera
|
|
</button>
|
|
</div>
|
|
|
|
{isLoading ? (
|
|
<p className="text-sm text-muted-foreground">Cargando...</p>
|
|
) : wallets && wallets.length > 0 ? (
|
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
{wallets.map((wallet) => (
|
|
<WalletCard key={wallet.id} wallet={wallet} />
|
|
))}
|
|
</div>
|
|
) : (
|
|
<p className="text-sm text-muted-foreground">
|
|
No hay billeteras. Creá una para empezar.
|
|
</p>
|
|
)}
|
|
|
|
<CreateWalletDialog open={createOpen} onOpenChange={setCreateOpen} />
|
|
</div>
|
|
);
|
|
}
|