{/* Account List */}
{displayAccounts.map((account) => {
const isActive = account.id === activeAccountId;
const isDraggable = !account.isDefault && accounts.length > 2;
return (
handleDragStart(e, account.id) : undefined}
onDragOver={isDraggable ? (e) => handleDragOver(e, account.id) : undefined}
onDrop={isDraggable ? (e) => handleDrop(e, account.id) : undefined}
onDragEnd={isDraggable ? resetDrag : undefined}
className={cn(
"group/acct relative",
dragId === account.id && "opacity-50",
dragOverId === account.id && dragId !== account.id && "border-t-2 border-primary"
)}
>
{isDraggable && (
)}
);
})}
{/* Separator + Add Account */}
{accounts.length < getMaxAccounts() && (
)}
{/* Separator + Actions */}
{activeAccount && !activeAccount.isDefault && accounts.length > 1 && (
)}
{accounts.length > 1 && (
)}
,
document.body
)}
>
);
}