/* global React, COPY, LANGS */ const { useState, useEffect } = React; // ─────────────────────────────────────────────────── // Icons (inline SVG) // ─────────────────────────────────────────────────── const Icon = { auto: () => ( ), free: () => ( ), photo: () => ( ), dict: () => ( ), voice: () => ( ), natural: () => ( ), stats: () => ( ), alt: () => ( ), reverse: () => ( ), arrow: () => ( ), send: () => ( ), }; // ─────────────────────────────────────────────────── // iPhone mockup with Telegram chat // ─────────────────────────────────────────────────── function PhoneFrame({ children, scale = 1 }) { return (
{/* Side buttons */}
{/* Dynamic Island */}
{children}
); } function StatusBar() { return (
9:41
); } function TgHeader({ name = "AI Translate", status = "online", lang }) { const t = COPY[lang]; return (
AI
{name}
{lang === "ru" ? "в сети" : status}
); } function Bubble({ from = "user", children, accent }) { const isUser = from === "user"; return (
{children}
); } function PinnedBar({ lang }) { const text = lang === "ru" ? "Перевожу на" : "Translating to"; return (
📌 Pinned
{text} 🇷🇺 Русский
); } function ChatBackground({ children }) { return (
{children}
); } // Hero phone — "Hello, world" example showing auto-detect function HeroChat({ lang, accent }) { const t = lang === "ru"; return ( <> How are you holding up after all that?
Ну как ты, отошёл уже после всего?
💾 {t ? "тапни, чтобы скопировать" : "tap to copy"}
Alternatives ↩ Reverse 📊 Stats
こんにちは、元気?
Привет, как ты?
); } function Pill({ children }) { return (
{children}
); } function ReplyKeyboard({ lang }) { const t = lang === "ru"; return (
{t ? "Сменить на" : "Switch to"} 🇬🇧 English 🌐 Languages
💬 Feedback 📋 History
); } function KbBtn({ children, flex = 1 }) { return (
{children}
); } // Demo phone — Photo OCR scenario function DemoChat({ lang, accent }) { const t = lang === "ru"; return ( <> {/* Photo bubble */}
Trabajaba en silencio,
con la paciencia
de un viejo relojero…
📷 IMG_4521.jpg
{/* OCR result */}
{t ? "Оригинал:" : "Original:"}
Trabajaba en silencio, con la paciencia de un viejo relojero…
{t ? "Перевод:" : "Translation:"}
Он работал молча, с терпением старого часовщика…
Alternatives ↩ Reverse
); } window.PhoneFrame = PhoneFrame; window.HeroChat = HeroChat; window.DemoChat = DemoChat; window.Icon = Icon;