fix(web): distinguir WhatsApp no configurado de otros errores de estado

Ajustes y el paso del onboarding mostraban "no está disponible" ante
cualquier fallo de GET /whatsapp/status. Ahora solo un 503 da ese
mensaje; el resto muestra el código del error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jose Selesan
2026-10-22 19:02:14 -03:00
parent 2467ebc0f6
commit bef4056f8e
5 changed files with 40 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
import { ArrowLeft, ArrowRight, BadgeCheck, CheckCircle2, Loader2 } from 'lucide-react'
import { Badge, Button } from '../../components/ui'
import { ApiError } from '../../lib/api'
import type { WhatsappCallbackFeedback } from '../whatsapp'
import {
linksWithQr,
@@ -8,6 +9,7 @@ import {
WhatsappQrModal,
whatsappCallbackErrorMessage,
whatsappStatusBadgeVariant,
whatsappStatusErrorMessage,
whatsappStatusLabel,
} from '../whatsapp'
@@ -69,6 +71,12 @@ export function WhatsappStep({ feedback, onNext, onBack }: WhatsappStepProps) {
<Loader2 className="size-4 animate-spin" />
Consultando tu WhatsApp…
</p>
) : statusQuery.isError ? (
<p className="text-sm text-foreground/60">
{whatsappStatusErrorMessage(
statusQuery.error instanceof ApiError ? statusQuery.error.status : null,
)}
</p>
) : (
<p className="text-sm text-foreground/60">
{usesQr