2022-03-25 12:42:04 -07:00
|
|
|
import React from 'react';
|
|
|
|
|
2022-03-25 15:47:19 -07:00
|
|
|
import { Stack } from 'soapbox/components/ui';
|
2022-03-25 12:42:04 -07:00
|
|
|
import { useSoapboxConfig } from 'soapbox/hooks';
|
|
|
|
|
2022-11-15 09:23:36 -08:00
|
|
|
import CryptoAddress from './crypto-address';
|
2022-03-25 12:42:04 -07:00
|
|
|
|
|
|
|
interface ISiteWallet {
|
2022-03-25 13:16:05 -07:00
|
|
|
limit?: number,
|
2022-03-25 12:42:04 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
const SiteWallet: React.FC<ISiteWallet> = ({ limit }): JSX.Element => {
|
2022-03-28 13:29:39 -07:00
|
|
|
const { cryptoAddresses } = useSoapboxConfig();
|
|
|
|
const addresses = typeof limit === 'number' ? cryptoAddresses.take(limit) : cryptoAddresses;
|
2022-03-25 12:42:04 -07:00
|
|
|
|
|
|
|
return (
|
2022-03-25 15:47:19 -07:00
|
|
|
<Stack space={4}>
|
2022-03-28 13:29:39 -07:00
|
|
|
{addresses.map(address => (
|
2022-03-25 12:42:04 -07:00
|
|
|
<CryptoAddress
|
2022-03-28 13:29:39 -07:00
|
|
|
key={address.ticker}
|
|
|
|
address={address.address}
|
|
|
|
ticker={address.ticker}
|
|
|
|
note={address.note}
|
2022-03-25 12:42:04 -07:00
|
|
|
/>
|
|
|
|
))}
|
2022-03-25 15:47:19 -07:00
|
|
|
</Stack>
|
2022-03-25 12:42:04 -07:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default SiteWallet;
|