import React, {useCallback} from 'react' import {View} from 'react-native' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useProfileQuery} from '#/state/queries/profile' import {type SessionAccount, useSession} from '#/state/session' import {UserAvatar} from '#/view/com/util/UserAvatar' import {atoms as a, useTheme} from '#/alf' import {Check_Stroke2_Corner0_Rounded as Check} from '#/components/icons/Check' import {ChevronRight_Stroke2_Corner0_Rounded as Chevron} from '#/components/icons/Chevron' import {Button} from './Button' import {Text} from './Typography' export function AccountList({ onSelectAccount, onSelectOther, otherLabel, }: { onSelectAccount: (account: SessionAccount) => void onSelectOther: () => void otherLabel?: string }) { const {isSwitchingAccounts, currentAccount, accounts} = useSession() const t = useTheme() const {_} = useLingui() const onPressAddAccount = useCallback(() => { onSelectOther() }, [onSelectOther]) return ( {accounts.map(account => ( ))} ) } function AccountItem({ account, onSelect, isCurrentAccount, }: { account: SessionAccount onSelect: (account: SessionAccount) => void isCurrentAccount: boolean }) { const t = useTheme() const {_} = useLingui() const {data: profile} = useProfileQuery({did: account.did}) const onPress = React.useCallback(() => { onSelect(account) }, [account, onSelect]) return ( ) }