From 315add23cae2e927c338226dd3b16ef7c5e45af2 Mon Sep 17 00:00:00 2001 From: Developing-Gamer Date: Wed, 27 May 2026 12:31:13 -0700 Subject: [PATCH] Refresh support conversations UI. Co-authored-by: Cursor --- .../[projectId]/conversations/page-client.tsx | 324 +++++++++--------- 1 file changed, 160 insertions(+), 164 deletions(-) diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/conversations/page-client.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/conversations/page-client.tsx index 0eac87f8b..d1ed9052d 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/conversations/page-client.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/conversations/page-client.tsx @@ -3,18 +3,22 @@ import { useAdminApp } from "@/app/(main)/(protected)/projects/[projectId]/use-admin-app"; import { UserPickerTable } from "@/components/data-table/user-picker-table"; import { useRouter } from "@/components/router"; -import { DesignAlert, DesignBadge, DesignCard, DesignCategoryTabs, DesignInput, DesignSelectorDropdown } from "@/components/design-components"; +import { + DesignAlert, + DesignBadge, + DesignButton, + DesignCard, + DesignCategoryTabs, + DesignDialog, + DesignDialogClose, + DesignInput, + DesignSelectorDropdown, +} from "@/components/design-components"; import { Avatar, AvatarFallback, AvatarImage, Button, - Dialog, - DialogContent, - DialogDescription, - DialogHeader, - DialogTitle, - Input, Select, SelectContent, SelectItem, @@ -582,7 +586,6 @@ function NewConversationDialog(props: { const [subject, setSubject] = useState(""); const [initialMessage, setInitialMessage] = useState(""); const [priority, setPriority] = useState("normal"); - const [isSubmitting, setIsSubmitting] = useState(false); const [errorMessage, setErrorMessage] = useState(null); useEffect(() => { @@ -600,36 +603,72 @@ function NewConversationDialog(props: { const canSubmit = subject.trim() !== "" && initialMessage.trim() !== ""; return ( - - - - Create conversation - - Start a support conversation for a user and keep replies, notes, and context in one place. - - + + + + Cancel + + + { + if (!canSubmit) { + return; + } + const nextUserId = selectedUserId ?? throwErr("A support conversation must be attached to a selected user."); -
-
- - User - - {selectedUserLabel != null ? ( -
- {selectedUserLabel} - -
- ) : ( + setErrorMessage(null); + const result = await createConversation(props.currentUser, { + projectId: props.projectId, + userId: nextUserId, + subject: subject.trim(), + initialMessage: initialMessage.trim(), + priority, + }); + props.onCreated(result.conversationId, nextUserId); + props.onOpenChange(false); + }} + > + + Create Conversation + +
+ )} + > +
+
+ + User + + {selectedUserLabel != null ? ( +
+ {selectedUserLabel} + +
+ ) : ( +
(
- -
-
- - Subject - - setSubject(event.target.value)} - placeholder="Password reset loop on mobile" - />
-
- - Priority - - -
-
+ )} +
+
- Initial message + Subject -