Ajusta portal e desktop para máquina vinculada
This commit is contained in:
parent
0cac7aa23a
commit
ba0dcddefb
4 changed files with 62 additions and 9 deletions
|
|
@ -79,7 +79,7 @@ export function PortalShell({ children }: PortalShellProps) {
|
|||
<GalleryVerticalEnd className="size-4" />
|
||||
</span>
|
||||
<div className="flex flex-col">
|
||||
<span className="text-xs font-semibold tracking-[0.04em] text-neutral-500 sm:tracking-[0.06em]">
|
||||
<span className="text-sm text-neutral-500">
|
||||
Portal do Cliente
|
||||
</span>
|
||||
<span className="text-lg font-semibold text-neutral-900">Raven</span>
|
||||
|
|
|
|||
|
|
@ -48,10 +48,18 @@ export function PortalTicketForm() {
|
|||
const isFormValid = useMemo(() => {
|
||||
return Boolean(subject.trim() && description.trim() && categoryId && subcategoryId)
|
||||
}, [subject, description, categoryId, subcategoryId])
|
||||
const isViewerReady = Boolean(viewerId)
|
||||
|
||||
async function handleSubmit(event: React.FormEvent) {
|
||||
event.preventDefault()
|
||||
if (!viewerId || !isFormValid || isSubmitting) return
|
||||
if (isSubmitting || !isFormValid) return
|
||||
if (!viewerId) {
|
||||
toast.error(
|
||||
"Não foi possível identificar o colaborador vinculado a esta máquina. Tente abrir novamente o portal ou contate o suporte.",
|
||||
{ id: "portal-new-ticket" }
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const trimmedSubject = subject.trim()
|
||||
const trimmedSummary = summary.trim()
|
||||
|
|
@ -113,6 +121,11 @@ export function PortalTicketForm() {
|
|||
<CardTitle className="text-xl font-semibold text-neutral-900">Abrir novo chamado</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-6 px-5 pb-6">
|
||||
{!isViewerReady ? (
|
||||
<div className="rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700">
|
||||
Vincule esta máquina a um colaborador na aplicação desktop para enviar chamados em nome dele.
|
||||
</div>
|
||||
) : null}
|
||||
<form onSubmit={handleSubmit} className="space-y-6">
|
||||
<div className="space-y-3">
|
||||
<div className="space-y-1">
|
||||
|
|
@ -186,7 +199,7 @@ export function PortalTicketForm() {
|
|||
</Button>
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={!isFormValid || isSubmitting || !viewerId}
|
||||
disabled={!isFormValid || isSubmitting}
|
||||
className="rounded-full bg-neutral-900 px-6 text-sm font-semibold text-white hover:bg-neutral-900/90"
|
||||
>
|
||||
Registrar chamado
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue