mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-13 00:46:54 +02:00
fix: resolve TypeScript errors in ZapWindow
- Remove unused imports (useEffect, isAddressableKind, NostrEvent) - Fix walletInfo access: fetch from getInfo() hook instead of direct property - Store wallet info in component state with useEffect - All TypeScript syntax errors resolved
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
* - Shows feed render of zapped event
|
||||
*/
|
||||
|
||||
import { useState, useEffect, useMemo } from "react";
|
||||
import { useState, useMemo, useEffect } from "react";
|
||||
import { toast } from "sonner";
|
||||
import {
|
||||
Zap,
|
||||
@@ -43,8 +43,6 @@ import { getProfileContent } from "applesauce-core/helpers";
|
||||
import { getDisplayName } from "@/lib/nostr-utils";
|
||||
import { KindRenderer } from "./nostr/kinds";
|
||||
import type { EventPointer, AddressPointer } from "@/lib/open-parser";
|
||||
import { isAddressableKind } from "applesauce-core/helpers";
|
||||
import type { NostrEvent } from "@/types/nostr";
|
||||
|
||||
export interface ZapWindowProps {
|
||||
/** Recipient pubkey (who receives the zap) */
|
||||
@@ -83,7 +81,17 @@ export function ZapWindow({
|
||||
|
||||
const recipientProfile = useProfile(recipientPubkey, eventStore);
|
||||
|
||||
const { wallet, walletInfo, payInvoice, refreshBalance } = useWallet();
|
||||
const { wallet, payInvoice, refreshBalance, getInfo } = useWallet();
|
||||
|
||||
// Fetch wallet info
|
||||
const [walletInfo, setWalletInfo] = useState<any>(null);
|
||||
useEffect(() => {
|
||||
if (wallet) {
|
||||
getInfo()
|
||||
.then((info) => setWalletInfo(info))
|
||||
.catch((error) => console.error("Failed to get wallet info:", error));
|
||||
}
|
||||
}, [wallet, getInfo]);
|
||||
|
||||
const [selectedAmount, setSelectedAmount] = useState<number | null>(null);
|
||||
const [customAmount, setCustomAmount] = useState("");
|
||||
|
||||
Reference in New Issue
Block a user