mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-06-06 10:41:21 +02:00
fix: replace 'any' types with proper IAccount<ISigner, unknown, unknown>
- Updated AccountCard component to use IAccount<ISigner, unknown, unknown> - Updated switchAccount function to use proper type - Added ISigner import to both files - Maintains type safety while supporting all account types
This commit is contained in:
@@ -9,12 +9,14 @@ import { Button } from "@/components/ui/button";
|
|||||||
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
import Nip05 from "@/components/nostr/nip05";
|
import Nip05 from "@/components/nostr/nip05";
|
||||||
|
import type { IAccount } from "applesauce-accounts";
|
||||||
|
import type { ISigner } from "applesauce-signers";
|
||||||
|
|
||||||
function AccountCard({
|
function AccountCard({
|
||||||
account,
|
account,
|
||||||
isActive,
|
isActive,
|
||||||
}: {
|
}: {
|
||||||
account: any;
|
account: IAccount<ISigner, unknown, unknown>;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
}) {
|
}) {
|
||||||
const profile = useProfile(account.pubkey);
|
const profile = useProfile(account.pubkey);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import { RelayLink } from "./RelayLink";
|
|||||||
import SettingsDialog from "@/components/SettingsDialog";
|
import SettingsDialog from "@/components/SettingsDialog";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import type { IAccount } from "applesauce-accounts";
|
import type { IAccount } from "applesauce-accounts";
|
||||||
|
import type { ISigner } from "applesauce-signers";
|
||||||
|
|
||||||
function UserAvatar({ pubkey }: { pubkey: string }) {
|
function UserAvatar({ pubkey }: { pubkey: string }) {
|
||||||
const profile = useProfile(pubkey);
|
const profile = useProfile(pubkey);
|
||||||
@@ -85,7 +86,7 @@ export default function UserMenu() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchAccount(targetAccount: IAccount<any, any, any>) {
|
function switchAccount(targetAccount: IAccount<ISigner, unknown, unknown>) {
|
||||||
accounts.setActive(targetAccount.id);
|
accounts.setActive(targetAccount.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user