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