Surface machine context when collaborator missing
This commit is contained in:
parent
a1bd3bb7b9
commit
69955ae80c
1 changed files with 32 additions and 0 deletions
|
|
@ -155,6 +155,38 @@ export function PortalShell({ children }: PortalShellProps) {
|
||||||
Recuperando dados do colaborador vinculado...
|
Recuperando dados do colaborador vinculado...
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
{!machineContextError && !machineContextLoading && machineContext && !machineContext.assignedUserId ? (
|
||||||
|
<div className="rounded-xl border border-amber-300 bg-amber-50 px-4 py-3 text-sm text-amber-800 shadow-sm">
|
||||||
|
<p className="font-semibold">Debug: m<EFBFBD>quina autenticada sem colaborador vinculado.</p>
|
||||||
|
<p className="mt-1 text-xs text-amber-700">
|
||||||
|
Copie os dados abaixo e compartilhe com o suporte para investigar.
|
||||||
|
</p>
|
||||||
|
<pre className="mt-2 max-h-64 overflow-y-auto rounded-lg bg-white/70 px-3 py-2 text-[11px] leading-tight text-amber-900">
|
||||||
|
{JSON.stringify(machineContext, null, 2)}
|
||||||
|
</pre>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => {
|
||||||
|
const payload = {
|
||||||
|
machineContext,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
navigator.clipboard
|
||||||
|
.writeText(JSON.stringify(payload, null, 2))
|
||||||
|
.catch(() => {
|
||||||
|
console.warn("N<>o foi poss<73>vel copiar automaticamente. Selecione o texto manualmente.", payload)
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.warn("Clipboard n<>o suportado. Selecione manualmente.", error)
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
className="mt-2 inline-flex items-center rounded-md border border-amber-300 px-3 py-1 text-xs font-semibold text-amber-800 transition hover:bg-amber-100"
|
||||||
|
>
|
||||||
|
Copiar detalhes
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
{children}
|
{children}
|
||||||
</main>
|
</main>
|
||||||
<footer className="border-t border-slate-200 bg-white/70">
|
<footer className="border-t border-slate-200 bg-white/70">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue