From 616ca5f25924ebc3fddc036c390b2cca9dfc3efe Mon Sep 17 00:00:00 2001 From: Gitead Date: Thu, 3 Sep 2026 16:05:30 -0400 Subject: [PATCH] feat: add live translation UI section above dial pad Google Translate-style side-by-side layout with per-side language pickers on the patient connection page. UI shell only for now, no translation provider wired up yet. Co-Authored-By: Claude Sonnet 5 --- .../patient-connection/live-translate.tsx | 140 ++++++++++++++++++ .../src/pages/patient-connection-page.tsx | 6 + 2 files changed, 146 insertions(+) create mode 100644 apps/Frontend/src/components/patient-connection/live-translate.tsx diff --git a/apps/Frontend/src/components/patient-connection/live-translate.tsx b/apps/Frontend/src/components/patient-connection/live-translate.tsx new file mode 100644 index 00000000..fa7bdb4c --- /dev/null +++ b/apps/Frontend/src/components/patient-connection/live-translate.tsx @@ -0,0 +1,140 @@ +import { useState } from "react"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; +import { Textarea } from "@/components/ui/textarea"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import { Languages, ArrowLeftRight, Mic } from "lucide-react"; + +const LANGUAGES = [ + { code: "en", label: "English" }, + { code: "es", label: "Spanish" }, + { code: "pt", label: "Portuguese" }, + { code: "zh", label: "Chinese" }, + { code: "vi", label: "Vietnamese" }, + { code: "ht", label: "Haitian Creole" }, + { code: "fr", label: "French" }, + { code: "ar", label: "Arabic" }, + { code: "ru", label: "Russian" }, +]; + +export function LiveTranslate() { + const [leftLang, setLeftLang] = useState("en"); + const [rightLang, setRightLang] = useState("es"); + const [leftText, setLeftText] = useState(""); + const [rightText, setRightText] = useState(""); + + const handleSwap = () => { + setLeftLang(rightLang); + setRightLang(leftLang); + setLeftText(rightText); + setRightText(leftText); + }; + + return ( + + + + + Live Translation + + + +
+ {/* Left side */} +
+ +
+