/** * @license * SPDX-License-Identifier: Apache-2.0 */ import React, { useState } from 'react'; import { LandingPageConfig } from './types'; import { defaultLandingConfig } from './data/landingData'; import { TopBar, ActiveTab, ViewportMode } from './components/TopBar'; import { LandingPagePreview } from './components/LandingPagePreview'; import { HtmlCodeExporter } from './components/HtmlCodeExporter'; import { AffiliateCustomizer } from './components/AffiliateCustomizer'; import { GoogleAppsScriptGuide } from './components/GoogleAppsScriptGuide'; export default function App() { const [config, setConfig] = useState(defaultLandingConfig); const [activeTab, setActiveTab] = useState('preview'); const [viewportMode, setViewportMode] = useState('desktop'); const handleConfigChange = (updated: Partial) => { setConfig((prev) => ({ ...prev, ...updated })); }; const handleResetConfig = () => { setConfig(defaultLandingConfig); }; const getViewportContainerClass = () => { if (activeTab !== 'preview') return 'w-full'; switch (viewportMode) { case 'tablet': return 'max-w-[768px] mx-auto my-6 shadow-2xl rounded-2xl border-4 border-slate-700 overflow-hidden bg-white'; case 'mobile': return 'max-w-[390px] mx-auto my-6 shadow-2xl rounded-3xl border-8 border-slate-800 overflow-hidden bg-white'; case 'desktop': default: return 'w-full'; } }; return (
{/* Top Controller Bar */} {/* Main View Area */}
{activeTab === 'preview' && (
)} {activeTab === 'code' && (
)} {activeTab === 'customize' && (
)} {activeTab === 'guide' && (
)}
); }