From 1c29014f6e09340ba47c40160151d621392632d9 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 17:28:43 +0000 Subject: [PATCH] Changes Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com> --- .../mika/telegram/StepConfiguring.tsx | 67 ----------------- src/components/mika/telegram/StepNaming.tsx | 71 ------------------- 2 files changed, 138 deletions(-) delete mode 100644 src/components/mika/telegram/StepConfiguring.tsx delete mode 100644 src/components/mika/telegram/StepNaming.tsx diff --git a/src/components/mika/telegram/StepConfiguring.tsx b/src/components/mika/telegram/StepConfiguring.tsx deleted file mode 100644 index 049812a..0000000 --- a/src/components/mika/telegram/StepConfiguring.tsx +++ /dev/null @@ -1,67 +0,0 @@ -"use client"; - -import { useEffect, useState } from "react"; -import { Loader2, AlertCircle } from "lucide-react"; -import { Button } from "@/components/ui/button"; -import { invokeFunction } from "@/lib/invoke-function"; - -interface Props { - onConfigured: () => void; - onSkip: () => void; -} - -export function StepConfiguring({ onConfigured, onSkip }: Props) { - const [state, setState] = useState<"loading" | "error">("loading"); - const [error, setError] = useState(null); - const [attempt, setAttempt] = useState(0); - - useEffect(() => { - let cancelled = false; - setState("loading"); - setError(null); - - (async () => { - const { error: err } = await invokeFunction("configure-telegram-webhook"); - if (cancelled) return; - if (err) { - setError(err.message); - setState("error"); - return; - } - window.setTimeout(() => { - if (!cancelled) onConfigured(); - }, 800); - })(); - - return () => { - cancelled = true; - }; - }, [attempt, onConfigured]); - - return ( -
- {state === "loading" && ( - <> - -

- Configurando recebimento de mensagens... -

- - )} - - {state === "error" && ( -
- -

Falha ao configurar webhook

- {error &&

{error}

} -
- - -
-
- )} -
- ); -} diff --git a/src/components/mika/telegram/StepNaming.tsx b/src/components/mika/telegram/StepNaming.tsx deleted file mode 100644 index e85ab35..0000000 --- a/src/components/mika/telegram/StepNaming.tsx +++ /dev/null @@ -1,71 +0,0 @@ -"use client"; - -import { useState } from "react"; -import { Copy, Check } from "lucide-react"; -import { Button } from "@/components/ui/button"; -import { Input } from "@/components/ui/input"; -import { toast } from "sonner"; - -interface Props { - suggestedName: string; - suggestedUsername: string; - onNext: () => void; -} - -export function StepNaming({ suggestedName, suggestedUsername, onNext }: Props) { - return ( -
-

Escolha os nomes

-

- O BotFather vai pedir dois nomes. Use nossas sugestões se quiser. -

- -
- - -
- -
- -
-
- ); -} - -function CopyField({ label, value, help }: { label: string; value: string; help?: string }) { - const [copied, setCopied] = useState(false); - - async function copy() { - try { - await navigator.clipboard.writeText(value); - setCopied(true); - toast.success("Copiado para a área de transferência"); - window.setTimeout(() => setCopied(false), 1500); - } catch { - toast.error("Não foi possível copiar"); - } - } - - return ( -
- -
- - -
- {help &&

{help}

} -
- ); -}