import React, { useCallback, useState } from 'react';
import { View, Text } from 'react-native';
import Svg, { Circle as SvgCircle } from 'react-native-svg';
import type { AlgorandAccount } from '../types/algorand';
import { formatAddress } from '../utils/format';
import { SearchSheet } from '../ui/SearchSheet';
function OnlineIndicator({ isOnline }: { isOnline: boolean }) {
return (
);
}
interface AccountSearchProps {
data: AlgorandAccount[];
onSelect?: (account: AlgorandAccount) => void;
placeholder?: string;
className?: string;
}
export function AccountSearch({
data,
onSelect,
placeholder = 'Search accounts...',
className,
}: AccountSearchProps) {
const [selected, setSelected] = useState(null);
const handleSelect = useCallback(
(account: AlgorandAccount) => {
setSelected(account);
onSelect?.(account);
},
[onSelect],
);
const renderItem = useCallback(
(account: AlgorandAccount) => (
AC
{formatAddress(account.address)}
{account.balance / 1_000_000} ALGO - {account.assets.length} assets
),
[],
);
return (
{selected && (
Selected Account
{renderItem(selected)}
)}
);
}