'use client' /** * Admin Panel fuer Website-Content * * Erlaubt das Bearbeiten aller Website-Texte: * - Hero Section, Features, FAQ, Pricing, Trust Indicators, Testimonial * * NEU: Live-Preview der Website zeigt Kontext beim Bearbeiten */ import LanguageSelector from '@/components/LanguageSelector' import AdminLayout from '@/components/admin/AdminLayout' import { useContentEditor } from './_components/useContentEditor' import ContentEditorTabs from './_components/ContentEditorTabs' import LivePreviewPanel from './_components/LivePreviewPanel' export default function AdminPage() { const editor = useContentEditor() if (editor.loading) { return ( {editor.t('admin_loading')} ) } if (!editor.content) { return ( {editor.t('admin_error')} ) } return ( {/* Toolbar */} editor.setShowPreview(!editor.showPreview)} className={`flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${ editor.showPreview ? 'bg-blue-100 text-blue-700' : 'bg-slate-100 text-slate-600 hover:bg-slate-200' }`} title={editor.showPreview ? 'Preview ausblenden' : 'Preview einblenden'} > Live-Preview {editor.message && ( {editor.message.text} )} {editor.saving ? editor.t('admin_saving') : editor.t('admin_save')} {/* Tabs */} {(['hero', 'features', 'faq', 'pricing', 'other'] as const).map((tab) => ( editor.setActiveTab(tab)} className={`px-4 py-2 text-sm font-medium rounded-md transition-colors ${ editor.activeTab === tab ? 'bg-white text-slate-900 shadow-sm' : 'text-slate-600 hover:text-slate-900' }`} > {tab === 'hero' && editor.t('admin_tab_hero')} {tab === 'features' && editor.t('admin_tab_features')} {tab === 'faq' && editor.t('admin_tab_faq')} {tab === 'pricing' && editor.t('admin_tab_pricing')} {tab === 'other' && editor.t('admin_tab_other')} ))} {/* Split Layout: Editor + Preview */} {editor.showPreview && ( )} ) }