Commercial frontend cleanup: fix admin TypeError, simplify UI for end users, add Suspense boundaries

This commit is contained in:
2025-11-30 22:28:59 +01:00
parent 3346817a8a
commit d31a132808
7 changed files with 323 additions and 452 deletions

View File

@@ -1,30 +1,15 @@
"use client";
import { FileUploader } from "@/components/file-uploader";
import { useTranslationStore } from "@/lib/store";
import { Badge } from "@/components/ui/badge";
import { Settings } from "lucide-react";
import Link from "next/link";
import {
LandingHero,
FeaturesSection,
PricingPreview,
SelfHostCTA
} from "@/components/landing-sections";
import Link from "next/link";
export default function Home() {
const { settings } = useTranslationStore();
const providerNames: Record<string, string> = {
openrouter: "OpenRouter",
google: "Google Translate",
ollama: "Ollama",
deepl: "DeepL",
libre: "LibreTranslate",
webllm: "WebLLM",
openai: "OpenAI",
};
return (
<div className="space-y-0 -m-8">
{/* Hero Section */}
@@ -33,28 +18,11 @@ export default function Home() {
{/* Upload Section */}
<div id="upload" className="px-8 py-12 bg-zinc-900/30">
<div className="max-w-6xl mx-auto">
<div className="flex items-start justify-between mb-6">
<div>
<h2 className="text-2xl font-bold text-white">Translate Your Document</h2>
<p className="text-zinc-400 mt-1">
Upload and translate Excel, Word, and PowerPoint files while preserving all formatting.
</p>
</div>
{/* Current Configuration Badge */}
<Link href="/settings/services" className="flex items-center gap-2 px-3 py-2 rounded-lg bg-zinc-800/50 border border-zinc-700 hover:bg-zinc-800 transition-colors">
<Settings className="h-4 w-4 text-zinc-400" />
<div className="flex items-center gap-2">
<Badge variant="outline" className="border-teal-500/50 text-teal-400 text-xs">
{providerNames[settings.defaultProvider]}
</Badge>
{settings.defaultProvider === "ollama" && settings.ollamaModel && (
<Badge variant="outline" className="border-zinc-600 text-zinc-400 text-xs">
{settings.ollamaModel}
</Badge>
)}
</div>
</Link>
<div className="mb-6">
<h2 className="text-2xl font-bold text-white">Translate Your Document</h2>
<p className="text-zinc-400 mt-1">
Upload and translate Excel, Word, and PowerPoint files while preserving all formatting.
</p>
</div>
<FileUploader />
@@ -81,7 +49,6 @@ export default function Home() {
</div>
<div className="flex items-center gap-6 text-sm text-zinc-500">
<Link href="/pricing" className="hover:text-zinc-300">Pricing</Link>
<Link href="/ollama-setup" className="hover:text-zinc-300">Self-Host</Link>
<Link href="/terms" className="hover:text-zinc-300">Terms</Link>
<Link href="/privacy" className="hover:text-zinc-300">Privacy</Link>
</div>