0 ? (e) => openContextMenu(e, book) : undefined}
className={cn(
"flex items-center gap-3 py-2.5 px-3 rounded-md border border-border bg-background group"
)}
@@ -228,32 +264,32 @@ export function AddressBookManagementSettings() {
);
})()}
-
- {canRename && (
-
setEditingId(book.id)} className="text-muted-foreground">
-
-
- )}
- {canSetDefault && (
-
handleSetDefault(book)} disabled={isLoading} className="text-muted-foreground">
-
-
- )}
- {!book.isShared && book.myRights?.mayShare && (
-
setSharingId(book.id)} className="text-muted-foreground">
-
-
- )}
- {canDelete && (
+ {/* Phone: four icons next to the name left it a few letters, so the
+ actions sit behind a ⋮ there, as for calendars. */}
+ {actions.length > 0 && (
+
openContextMenuFrom(e.currentTarget, book, "end")}
+ >
+
+
+ )}
+
+ {actions.map((action) => (
void handleDelete(book)}
- disabled={isLoading}
- className="text-muted-foreground hover:text-destructive hover:bg-destructive/10"
+ key={action.id}
+ label={action.label}
+ onClick={action.run}
+ disabled={action.disabled}
+ className={cn(
+ "text-muted-foreground",
+ action.destructive && "hover:text-destructive hover:bg-destructive/10",
+ )}
>
-
+
- )}
+ ))}
);
@@ -285,6 +321,7 @@ export function AddressBookManagementSettings() {
return (
<>
+ {renderBookMenu()}
{/* In scoped mode (managing a shared account) hide the user's own
address books and show only the managed account's group. */}