diff --git a/apps/web/components/teams/invite-dialog.tsx b/apps/web/components/teams/invite-dialog.tsx
index 7db637d..b054097 100644
--- a/apps/web/components/teams/invite-dialog.tsx
+++ b/apps/web/components/teams/invite-dialog.tsx
@@ -13,6 +13,7 @@ import {
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet";
+import { InviteRecipientCombobox } from "@/components/teams/invite-recipient-combobox";
import { api } from "@/lib/trpc";
import { cn } from "@/lib/utils";
@@ -22,6 +23,13 @@ interface InviteDialogProps {
workspaceSlug: string;
/** Children render as the trigger; default is a primary "Invite" button. */
children?: React.ReactNode;
+ /**
+ * Optional. Called when the inviter picks an "already a member" suggestion
+ * from the autocomplete. Lets the teams page close the dialog and scroll
+ * the existing row into view. If omitted, the combobox just closes its
+ * dropdown and the user has to clear the input manually.
+ */
+ onFocusExistingMember?: (userId: string) => void;
}
/**
@@ -29,11 +37,15 @@ interface InviteDialogProps {
* accept URL on success so the inviter can copy/paste it into chat / DM
* until the transactional email send is wired up (filed follow-up).
*
- * The email input is a plain `` in this task; the smart recipient
- * autocomplete from `Task-invite-recipient-autocomplete` will swap it for
- * a combobox in a separate commit.
+ * The email input is the `InviteRecipientCombobox` from Task 3 — typing
+ * surfaces existing members, pending invites, and known users from the
+ * inviter's other workspaces before the "Send invite to " fallback.
*/
-export function InviteDialog({ workspaceSlug, children }: InviteDialogProps) {
+export function InviteDialog({
+ workspaceSlug,
+ children,
+ onFocusExistingMember,
+}: InviteDialogProps) {
const utils = api.useUtils();
const [open, setOpen] = React.useState(false);
const [email, setEmail] = React.useState("");
@@ -175,17 +187,21 @@ export function InviteDialog({ workspaceSlug, children }: InviteDialogProps) {