2022-05-14 01:07:44 +00:00
|
|
|
import Link from 'next/link'
|
2022-06-15 21:34:34 +00:00
|
|
|
|
2022-06-13 04:42:41 +00:00
|
|
|
import { User } from 'web/lib/firebase/users'
|
2022-05-09 13:04:36 +00:00
|
|
|
import { formatMoney } from 'common/util/format'
|
2022-03-17 07:50:45 +00:00
|
|
|
import { Avatar } from '../avatar'
|
2022-06-15 21:34:34 +00:00
|
|
|
import { trackCallback } from 'web/lib/service/analytics'
|
2021-12-20 03:12:12 +00:00
|
|
|
|
2022-05-14 01:07:44 +00:00
|
|
|
export function ProfileSummary(props: { user: User }) {
|
2021-12-20 03:12:12 +00:00
|
|
|
const { user } = props
|
|
|
|
return (
|
2022-09-27 21:16:48 +00:00
|
|
|
<Link href={`/${user.username}?tab=portfolio`}>
|
2022-06-15 21:34:34 +00:00
|
|
|
<a
|
|
|
|
onClick={trackCallback('sidebar: profile')}
|
2022-09-02 19:52:27 +00:00
|
|
|
className="group mb-3 flex flex-row items-center gap-4 truncate rounded-md py-3 text-gray-500 hover:bg-gray-100 hover:text-gray-700"
|
2022-06-15 21:34:34 +00:00
|
|
|
>
|
2022-05-14 01:07:44 +00:00
|
|
|
<Avatar avatarUrl={user.avatarUrl} username={user.username} noLink />
|
2022-01-27 23:24:44 +00:00
|
|
|
|
2022-05-14 01:07:44 +00:00
|
|
|
<div className="truncate">
|
|
|
|
<div>{user.name}</div>
|
2022-08-20 16:45:13 +00:00
|
|
|
<div className="text-sm">{formatMoney(Math.floor(user.balance))}</div>
|
2022-01-08 18:14:20 +00:00
|
|
|
</div>
|
2022-05-14 01:07:44 +00:00
|
|
|
</a>
|
|
|
|
</Link>
|
2021-12-20 03:12:12 +00:00
|
|
|
)
|
|
|
|
}
|