mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 12:31:26 -05:00
Fix: Open reply modal to correct tab
This commit is contained in:
@@ -103,6 +103,7 @@ export default function AdminContact() {
|
||||
const [emailThreads, setEmailThreads] = useState<EmailThread[]>([]);
|
||||
const [loadingThreads, setLoadingThreads] = useState(false);
|
||||
const [copiedTicket, setCopiedTicket] = useState<string | null>(null);
|
||||
const [activeTab, setActiveTab] = useState<string>('details');
|
||||
|
||||
// Fetch contact submissions
|
||||
const { data: submissions, isLoading } = useQuery({
|
||||
@@ -160,6 +161,9 @@ export default function AdminContact() {
|
||||
setAdminNotes(selectedSubmission.admin_notes || '');
|
||||
setReplyBody('');
|
||||
setShowReplyForm(false);
|
||||
} else {
|
||||
// Reset tab to details when dialog closes
|
||||
setActiveTab('details');
|
||||
}
|
||||
}, [selectedSubmission]);
|
||||
|
||||
@@ -281,6 +285,7 @@ export default function AdminContact() {
|
||||
e.stopPropagation();
|
||||
setSelectedSubmission(submission);
|
||||
setAdminNotes(submission.admin_notes || '');
|
||||
setActiveTab('thread');
|
||||
setShowReplyForm(true);
|
||||
};
|
||||
|
||||
@@ -591,7 +596,7 @@ export default function AdminContact() {
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
<Tabs defaultValue="details" className="flex-1 overflow-hidden flex flex-col">
|
||||
<Tabs value={activeTab} onValueChange={setActiveTab} className="flex-1 overflow-hidden flex flex-col">
|
||||
<TabsList className="w-full justify-start">
|
||||
<TabsTrigger value="details" className="flex-1">
|
||||
Details
|
||||
|
||||
Reference in New Issue
Block a user