Newer
Older
import { useStore } from 'nanostores/react'
import React from 'react'
import { hierarchy as hierarchyStore } from '../stores/accounts'
import { BaseProps } from '../types'
const Accounts: React.FC<BaseProps> = ({ className }) => {
const hierarchy = useStore(hierarchyStore)
if (hierarchy.length === 0) return <AddAccount />
return (
<>
<div className={className}>
{hierarchy.map((json, i) => (
<AccountsTree {...json} key={`${i}:${json.address}`} />
))}
</div>
</>
)
}
export default styled(Accounts)`
height: calc(100vh - 2px);
overflow-y: scroll;
margin-top: -25px;
padding-top: 25px;
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
`