diff --git a/app/routes/users/components/headplane-user-row.tsx b/app/routes/users/components/headplane-user-row.tsx
index e6b885c..c062a1c 100644
--- a/app/routes/users/components/headplane-user-row.tsx
+++ b/app/routes/users/components/headplane-user-row.tsx
@@ -11,9 +11,15 @@ interface HeadplaneUserRowProps {
user: HeadplaneUserData;
headscaleUsers: { id: string; name: string; claimed: boolean }[];
isSelf?: boolean;
+ isOwner?: boolean;
}
-export default function HeadplaneUserRow({ user, headscaleUsers, isSelf }: HeadplaneUserRowProps) {
+export default function HeadplaneUserRow({
+ user,
+ headscaleUsers,
+ isSelf,
+ isOwner,
+}: HeadplaneUserRowProps) {
const isOnline = user.machines.some((machine) => machine.online);
const lastSeen = user.machines.reduce(
(acc, machine) => Math.max(acc, new Date(machine.lastSeen).getTime()),
@@ -67,6 +73,7 @@ export default function HeadplaneUserRow({ user, headscaleUsers, isSelf }: Headp
diff --git a/app/routes/users/components/menu.tsx b/app/routes/users/components/menu.tsx
index 93ce028..195d29f 100644
--- a/app/routes/users/components/menu.tsx
+++ b/app/routes/users/components/menu.tsx
@@ -6,6 +6,7 @@ import { Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger } from "~/compo
import Delete from "../dialogs/delete-user";
import LinkUser from "../dialogs/link-user";
import Reassign from "../dialogs/reassign-user";
+import TransferOwnership from "../dialogs/transfer-ownership";
import type { HeadplaneUserData } from "../overview";
interface MenuProps {
@@ -13,11 +14,18 @@ interface MenuProps {
headscaleUsers: { id: string; name: string; claimed: boolean }[];
currentLink?: string;
isSelf?: boolean;
+ isOwner?: boolean;
}
-type Modal = "delete" | "reassign" | "link" | null;
+type Modal = "delete" | "reassign" | "link" | "transfer" | null;
-export default function UserMenu({ user, headscaleUsers, currentLink, isSelf }: MenuProps) {
+export default function UserMenu({
+ user,
+ headscaleUsers,
+ currentLink,
+ isSelf,
+ isOwner,
+}: MenuProps) {
const [modal, setModal] = useState(null);
const isLinked = currentLink !== undefined;
@@ -66,6 +74,16 @@ export default function UserMenu({ user, headscaleUsers, currentLink, isSelf }:
userId={user.linkedHeadscaleUser?.id ?? user.id}
/>
)}
+ {modal === "transfer" && (
+ {
+ if (!isOpen) setModal(null);
+ }}
+ targetDisplayName={displayName}
+ targetUserId={user.linkedHeadscaleUser?.id ?? user.id}
+ />
+ )}