import { useI18n, useT } from "@shared/i18n/context"; import { AccountCard } from "./AccountCard"; import type { Account, ProxyEntry } from "@shared/types"; interface AccountListProps { accounts: Account[]; loading: boolean; onDelete: (id: string) => Promise; onRefresh: () => void; refreshing: boolean; lastUpdated: Date | null; proxies?: ProxyEntry[]; onProxyChange?: (accountId: string, proxyId: string) => void; } export function AccountList({ accounts, loading, onDelete, onRefresh, refreshing, lastUpdated, proxies, onProxyChange }: AccountListProps) { const t = useT(); const { lang } = useI18n(); const updatedAtText = lastUpdated ? lastUpdated.toLocaleTimeString(lang === "zh" ? "zh-CN" : "en-US", { hour: "2-digit", minute: "2-digit", second: "2-digit" }) : null; return (

{t("connectedAccounts")}

{t("connectedAccountsDesc")}

{updatedAtText && ( )}
{loading ? (
{t("loadingAccounts")}
) : accounts.length === 0 ? (
{t("noAccounts")}
) : ( accounts.map((acct, i) => ( )) )}
); }