human hand off

This commit is contained in:
debu-2 2026-10-06 07:12:55 +05:30
parent d0fee5c8f7
commit 7af776196a
34 changed files with 2941 additions and 195 deletions

View file

@ -115,6 +115,7 @@ export default function DashboardPage() {
const [mailRefreshKey, setMailRefreshKey] = useState(0);
const [lens, setLens] = useState("all");
const [agentNav, setAgentNav] = useState(null);
const [openThreadId, setOpenThreadId] = useState(null);
const [labelsExpanded, setLabelsExpanded] = useState(false);
const [companyActive, setCompanyActive] = useState(null);
const [mustChangePassword, setMustChangePassword] = useState(false);
@ -211,6 +212,14 @@ export default function DashboardPage() {
triggerOpenCompose(context);
}
function openExternalThread(threadId) {
setCompanyActive(null);
setActive("Inbox");
setLens("all");
setAgentNav(null);
setOpenThreadId(threadId);
}
function emailSent() {
setActive("Outbox");
setMailRefreshKey((key) => key + 1);
@ -413,7 +422,7 @@ export default function DashboardPage() {
</div>
)}
{!companyActive && active === "Inbox" && agentNav === "handoff" && (
<HumanHandoff account={account} />
<HumanHandoff account={account} onOpenExternal={openExternalThread} />
)}
{!companyActive && active === "Inbox" && agentNav !== "handoff" && (
<MailboxView
@ -423,6 +432,7 @@ export default function DashboardPage() {
account={account}
lens={lens}
agentNav={agentNav}
initialThreadId={openThreadId}
onLogout={logout}
onOpenSettings={() => selectMailItem("Settings")}
onCompose={openCompose}