B2B-31: clean code
This commit is contained in:
@@ -40,7 +40,7 @@ export function PersonalAccountDropdown({
|
||||
paths,
|
||||
features,
|
||||
account,
|
||||
accounts
|
||||
accounts = []
|
||||
}: {
|
||||
user: User;
|
||||
|
||||
@@ -103,7 +103,7 @@ export function PersonalAccountDropdown({
|
||||
className ?? '',
|
||||
{
|
||||
['active:bg-secondary/50 items-center gap-4 rounded-md' +
|
||||
' hover:bg-secondary p-0 m-0 transition-colors border-1 rounded-md px-4 py-1 h-10']: showProfileName,
|
||||
' hover:bg-secondary m-0 transition-colors border-1 rounded-md px-4 py-1 h-10']: showProfileName,
|
||||
},
|
||||
)}
|
||||
>
|
||||
@@ -169,23 +169,23 @@ export function PersonalAccountDropdown({
|
||||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
<If condition={(accounts ?? []).length > 0}>
|
||||
<If condition={accounts.length > 0}>
|
||||
<span className='px-2 text-muted-foreground text-xs'>
|
||||
<Trans
|
||||
i18nKey={'teams:yourTeams'}
|
||||
values={{ teamsCount: (accounts ?? []).length }}
|
||||
values={{ teamsCount: accounts.length }}
|
||||
/>
|
||||
</span>
|
||||
|
||||
{(accounts ?? []).map((account) => (
|
||||
{accounts.map((account) => (
|
||||
<DropdownMenuItem key={account.value} asChild>
|
||||
<Link
|
||||
className={'s-full flex cursor-pointer items-center space-x-2'}
|
||||
href={`/home/${account.value}`}
|
||||
>
|
||||
<div className={'flex items-center'}>
|
||||
<Avatar className={'rounded-xs h-5 w-5'}>
|
||||
<AvatarImage src={account.image ?? undefined} />
|
||||
<Avatar className={'rounded-xs h-5 w-5 ' + account.image}>
|
||||
<AvatarImage {...(account.image && { src: account.image })} />
|
||||
|
||||
<AvatarFallback
|
||||
className={cn('rounded-md', {
|
||||
|
||||
Reference in New Issue
Block a user