%PDF- %PDF-
| Direktori : /home2/rezakur1/muakita.rezakurnia.com/Mua-Kita-Web/src/components/views/ |
| Current File : /home2/rezakur1/muakita.rezakurnia.com/Mua-Kita-Web/src/components/views/WebsiteView.tsx |
import React, { useState } from 'react';
import {
Globe, Sparkles, ExternalLink, Copy, Check, Save, Eye,
Smartphone, Monitor, Image as ImageIcon, Plus, Trash2, Edit3,
Star, CheckCircle2, MapPin, Phone, Instagram, Clock, Palette,
MessageSquare, Share2, Heart, Award, ArrowUpRight, ArrowRight,
ChevronRight, ChevronLeft, ChevronDown, Sliders, Search, BarChart3,
FileText, LayoutGrid, Zap, Users, Calendar, ArrowUp, Send, Youtube, Video
} from 'lucide-react';
interface WebsiteViewProps {
activeTab?: string;
setActiveTab?: (tab: string) => void;
triggerToast?: (message: string) => void;
onNavigateToPublicForm?: () => void;
}
export const WebsiteView: React.FC<WebsiteViewProps> = ({
activeTab = 'website',
setActiveTab = (_tab: string) => {},
triggerToast = (_msg: string) => {},
onNavigateToPublicForm
}) => {
// Current active sub-section in Website Builder
const getSubSectionFromTab = (tab: string) => {
if (tab === 'website_preview') return 'preview';
if (tab === 'website_edit') return 'edit';
if (tab === 'website_konten') return 'konten';
if (tab === 'website_seo') return 'seo';
if (tab === 'website_domain') return 'domain';
if (tab === 'website_analytics') return 'analytics';
return 'dashboard';
};
const [subSection, setSubSection] = useState<string>(getSubSectionFromTab(activeTab));
// Sync internal state if activeTab prop changes
React.useEffect(() => {
setSubSection(getSubSectionFromTab(activeTab));
}, [activeTab]);
const handleSubSectionChange = (section: string) => {
setSubSection(section);
let targetTab = 'website_dashboard';
if (section === 'preview') targetTab = 'website_preview';
else if (section === 'edit') targetTab = 'website_edit';
else if (section === 'konten') targetTab = 'website_konten';
else if (section === 'seo') targetTab = 'website_seo';
else if (section === 'domain') targetTab = 'website_domain';
else if (section === 'analytics') targetTab = 'website_analytics';
setActiveTab(targetTab);
};
// Modal Preview States
const [isPreviewModalOpen, setIsPreviewModalOpen] = useState(false);
const [previewDevice, setPreviewDevice] = useState<'desktop' | 'mobile'>('desktop');
const [timeRange, setTimeRange] = useState('7_hari');
const [showPublishDropdown, setShowPublishDropdown] = useState(false);
const [copiedLink, setCopiedLink] = useState(false);
// Active Editor Section (Hero, Services, Portfolio, Testimonials, CTA, Footer)
const [activeEditorTab, setActiveEditorTab] = useState<'hero' | 'layanan' | 'portfolio' | 'testimoni' | 'cta' | 'footer'>('hero');
const [isSplitView, setIsSplitView] = useState(true);
const [editorDevice, setEditorDevice] = useState<'desktop' | 'mobile'>('desktop');
// Website Data Configuration State matching exact reference image
const [websiteConfig, setWebsiteConfig] = useState({
studioName: 'Glamour Makeup Artist',
brandSubtitle: 'MAKEUP ARTIST',
subdomain: 'glamour',
lastUpdated: '24 Mei 2025, 14:30 WIB',
isOnline: true,
// Hero Section
heroBadge: 'MUA PROFESIONAL',
heroTitlePrefix: 'Wujudkan Pesona Terbaik di Hari',
heroTitleHighlight: 'Spesialmu',
heroSubtitle: 'Makeup profesional untuk setiap momen berharga Anda. Tampil flawless, percaya diri, dan berkesan sepanjang hari.',
heroImage: 'https://images.unsplash.com/photo-1519741497674-611481863552?auto=format&fit=crop&q=80&w=1200',
primaryCtaText: 'Reservasi Sekarang',
secondaryCtaText: 'Lihat Portofolio',
// Stats Section
stats: [
{ id: '1', number: '5+', label: 'Tahun Pengalaman' },
{ id: '2', number: '1000+', label: 'Klien Puas' },
{ id: '3', number: '4.9', label: 'Rating Terbaik' },
{ id: '4', number: 'Bersertifikat', label: 'MUA Profesional' }
],
// Layanan Section
servicesEyebrow: 'LAYANAN SAYA',
servicesTitle: 'Layanan Makeup Profesional',
servicesSubtitle: 'Berbagai layanan terbaik untuk kebutuhan spesial Anda',
services: [
{
id: 's1',
title: 'Makeup Pengantin',
desc: 'Makeup flawless untuk akad & resepsi, tampilan elegan sepanjang hari.',
icon: 'Heart'
},
{
id: 's2',
title: 'Makeup Wisuda',
desc: 'Tampil cantik dan percaya diri di hari kelulusan yang berkesan.',
icon: 'Users'
},
{
id: 's3',
title: 'Makeup Photoshoot',
desc: 'Makeup profesional untuk hasil foto yang sempurna dan memukau.',
icon: 'Sparkles'
},
{
id: 's4',
title: 'Makeup Event',
desc: 'Tampil memukau untuk acara spesial seperti party, evening, dan lainnya.',
icon: 'Award'
}
],
// Portfolio Section
portfolioEyebrow: 'PORTFOLIO',
portfolioTitle: 'Hasil Karya Terbaik',
portfolioSubtitle: 'Setiap tampilan dirancang dengan detail dan sentuhan profesional untuk hasil yang sempurna.',
featuredPortfolioImage: 'https://images.unsplash.com/photo-1519741497674-611481863552?auto=format&fit=crop&q=80&w=800',
portfolioGrid: [
{ id: 'p1', url: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?auto=format&fit=crop&q=80&w=600', title: 'Flawless Bride' },
{ id: 'p2', url: 'https://images.unsplash.com/photo-1487412720507-e7ab37603c6f?auto=format&fit=crop&q=80&w=600', title: 'Side Profile' },
{ id: 'p3', url: 'https://images.unsplash.com/photo-1522337360788-8b13dee7a37e?auto=format&fit=crop&q=80&w=600', title: 'Hair & Makeup' },
{ id: 'p4', url: 'https://images.unsplash.com/photo-1512496015851-a90fb38ba796?auto=format&fit=crop&q=80&w=600', title: 'Look Galeri (+25)' },
],
// Testimonials Section
testimonialsEyebrow: 'TESTIMONI',
testimonialsTitle: 'Apa Kata Mereka',
testimonialsSubtitle: 'Kepuasan klien adalah prioritas utama saya',
testimonials: [
{
id: 't1',
text: 'Makeupnya flawless banget, bertahan seharian dan semua orang compliment! Terima kasih banyak sudah bikin aku merasa paling spesial di hari bahagia ini ❤️',
name: 'Dewi Lestari',
role: 'Pengantin',
avatar: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?auto=format&fit=crop&q=80&w=200'
},
{
id: 't2',
text: 'Hasil makeup wisudaku natural tapi tetap cantik di kamera. Banyak yang nanya makeupnya di mana. Recommended!',
name: 'Siska Amanda',
role: 'Wisudawati',
avatar: 'https://images.unsplash.com/photo-1517841905240-472988babdf9?auto=format&fit=crop&q=80&w=200'
},
{
id: 't3',
text: 'Professional, ramah, dan hasilnya sesuai ekspektasi. Puas banget dan pasti akan pakai lagi untuk acara berikutnya!',
name: 'Rina Putri',
role: 'Konsumen',
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?auto=format&fit=crop&q=80&w=200'
}
],
// Banner Section
bannerTitle: 'Siap Tampil Memukau?',
bannerSubtitle: 'Yuk booking jadwal makeup Anda sekarang juga. Tanggal terbaik cepat penuh!',
bannerCta: 'Reservasi Sekarang',
bannerBgImage: 'https://images.unsplash.com/photo-1522337360788-8b13dee7a37e?auto=format&fit=crop&q=80&w=1200',
// Footer & Contact
address: 'Jl. beauty No. 123, Jakarta Selatan',
phone: '0812-3456-7890',
email: 'hello@glamourmua.com',
instagram: '@glamour.mua',
youtube: 'Glamour MUA Official',
tiktok: '@glamour.mua',
operatingHours: 'Setiap Hari: 08.00 - 20.00 WIB',
// SEO Settings
metaTitle: 'Glamour Makeup Artist | MUA & Bridal Specialist Jakarta',
metaDescription: 'Layanan MUA Profesional Jakarta melayani Makeup Pengantin, Wisuda, Engagement, & Event. Booking jadwal instant!',
keywords: 'Glamour MUA, MUA Jakarta, Makeup Pengantin, Makeup Wisuda, MUA Specialist'
});
const fullDomainUrl = `https://${websiteConfig.subdomain}.muakita.com`;
const handleCopyLink = () => {
navigator.clipboard.writeText(fullDomainUrl);
setCopiedLink(true);
triggerToast('Link website berhasil disalin ke clipboard!');
setTimeout(() => setCopiedLink(false), 2000);
};
const handlePublish = () => {
triggerToast('Website MUA berhasil dipublikasikan dan status ONLINE!');
setShowPublishDropdown(false);
};
// RENDERER FUNCTION FOR THE ACTUAL PUBLIC LANDING PAGE
const renderPublicWebsiteContent = () => {
return (
<div className="bg-[#FAF5F6] text-slate-800 font-sans min-h-screen selection:bg-rose-100 selection:text-rose-600">
{/* 1. NAVBAR */}
<header className="sticky top-0 bg-white/90 backdrop-blur-md z-40 border-b border-rose-100/60 shadow-2xs">
<div className="max-w-6xl mx-auto px-4 sm:px-6 h-20 flex items-center justify-between">
{/* Logo */}
<div className="flex items-center gap-2">
<span className="font-serif italic font-extrabold text-2xl text-[#EC167F] tracking-tight">
Glamour
</span>
<span className="text-[10px] font-extrabold tracking-widest text-slate-400 block -ml-1 mt-3 uppercase">
{websiteConfig.brandSubtitle}
</span>
</div>
{/* Nav Menu Links */}
<nav className="hidden lg:flex items-center gap-7 text-xs font-semibold text-slate-600">
<a href="#beranda" className="text-[#EC167F] font-bold">Beranda</a>
<a href="#tentang" className="hover:text-[#EC167F] transition-colors">Tentang Saya</a>
<a href="#layanan" className="hover:text-[#EC167F] transition-colors">Layanan</a>
<a href="#galeri" className="hover:text-[#EC167F] transition-colors">Galeri</a>
<a href="#testimoni" className="hover:text-[#EC167F] transition-colors">Testimoni</a>
<a href="#harga" className="hover:text-[#EC167F] transition-colors">Harga</a>
<a href="#kontak" className="hover:text-[#EC167F] transition-colors">Kontak</a>
</nav>
{/* CTA Button */}
<button
type="button"
onClick={onNavigateToPublicForm}
className="px-5 py-2.5 bg-[#EC167F] hover:bg-[#D41270] active:scale-95 text-white font-extrabold text-xs rounded-full shadow-md shadow-pink-500/20 transition-all cursor-pointer flex items-center gap-1.5"
>
<span>{websiteConfig.primaryCtaText}</span>
</button>
</div>
</header>
{/* 2. HERO SECTION */}
<section id="beranda" className="relative pt-8 pb-16 md:pt-12 md:pb-24 overflow-hidden bg-gradient-to-b from-[#FAF5F6] via-[#FDF2F4] to-white">
<div className="max-w-6xl mx-auto px-4 sm:px-6 grid grid-cols-1 lg:grid-cols-12 gap-8 items-center">
{/* Left Content */}
<div className="lg:col-span-6 space-y-6">
<div className="inline-flex items-center gap-1.5 px-3.5 py-1 bg-white border border-rose-200/80 rounded-full text-[11px] font-bold text-[#EC167F] shadow-2xs">
<span>☆</span>
<span>{websiteConfig.heroBadge}</span>
</div>
<h1 className="text-3xl sm:text-5xl font-black text-slate-900 tracking-tight leading-[1.15]">
{websiteConfig.heroTitlePrefix}{' '}
<span className="font-serif italic font-normal text-[#EC167F]">
{websiteConfig.heroTitleHighlight}
</span>
</h1>
<p className="text-xs sm:text-sm text-slate-600 font-normal leading-relaxed max-w-lg">
{websiteConfig.heroSubtitle}
</p>
{/* Action Buttons */}
<div className="flex items-center gap-3 pt-2">
<button
type="button"
onClick={onNavigateToPublicForm}
className="px-6 py-3 bg-[#EC167F] hover:bg-[#D41270] active:scale-95 text-white font-extrabold text-xs rounded-xl shadow-lg shadow-pink-500/25 transition-all cursor-pointer flex items-center gap-2"
>
<Calendar className="w-4 h-4" />
<span>{websiteConfig.primaryCtaText}</span>
</button>
<a
href="#galeri"
className="px-6 py-3 bg-white hover:bg-rose-50 text-slate-700 font-extrabold text-xs rounded-xl border border-rose-200/80 transition-colors cursor-pointer flex items-center gap-1.5"
>
<span>{websiteConfig.secondaryCtaText}</span>
</a>
</div>
{/* Stats Strip */}
<div className="pt-6 grid grid-cols-2 sm:grid-cols-4 gap-3 border-t border-rose-100">
{websiteConfig.stats.map((st) => (
<div key={st.id} className="p-2.5 bg-white/80 backdrop-blur-xs rounded-xl border border-rose-100/80">
<span className="text-sm font-black text-[#EC167F] block">{st.number}</span>
<span className="text-[10px] font-bold text-slate-500 block leading-tight">{st.label}</span>
</div>
))}
</div>
</div>
{/* Right Hero Image */}
<div className="lg:col-span-6 relative flex justify-center">
<div className="relative w-full max-w-md aspect-[4/5] rounded-3xl overflow-hidden shadow-2xl border-4 border-white">
<img
src={websiteConfig.heroImage}
alt="MUA Hero Model"
referrerPolicy="no-referrer"
className="w-full h-full object-cover"
/>
</div>
</div>
</div>
</section>
{/* 3. LAYANAN SECTION */}
<section id="layanan" className="py-16 bg-white">
<div className="max-w-6xl mx-auto px-4 sm:px-6 space-y-10">
<div className="text-center space-y-2 max-w-xl mx-auto">
<span className="text-[11px] font-black tracking-widest text-[#EC167F] uppercase block">
{websiteConfig.servicesEyebrow}
</span>
<h2 className="text-2xl sm:text-3xl font-black text-slate-900 tracking-tight">
{websiteConfig.servicesTitle}
</h2>
<p className="text-xs text-slate-500 font-medium">
{websiteConfig.servicesSubtitle}
</p>
</div>
{/* 4 Cards Grid */}
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-5">
{websiteConfig.services.map((srv) => (
<div
key={srv.id}
className="p-6 bg-[#FAF5F6] rounded-2xl border border-rose-100/80 shadow-2xs hover:shadow-md hover:border-pink-200 transition-all flex flex-col justify-between space-y-4 group"
>
<div className="space-y-3">
<div className="w-10 h-10 rounded-xl bg-pink-100/80 text-[#EC167F] flex items-center justify-center font-bold">
<Sparkles className="w-5 h-5" />
</div>
<h3 className="text-sm font-extrabold text-slate-900 group-hover:text-[#EC167F] transition-colors">
{srv.title}
</h3>
<p className="text-xs text-slate-500 font-normal leading-relaxed">
{srv.desc}
</p>
</div>
<button
type="button"
onClick={onNavigateToPublicForm}
className="text-xs font-bold text-[#EC167F] flex items-center gap-1 group-hover:translate-x-1 transition-transform cursor-pointer pt-2"
>
<span>Selengkapnya</span>
<ArrowRight className="w-3.5 h-3.5" />
</button>
</div>
))}
</div>
</div>
</section>
{/* 4. PORTFOLIO SECTION */}
<section id="galeri" className="py-16 bg-[#FAF5F6]">
<div className="max-w-6xl mx-auto px-4 sm:px-6 space-y-8">
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8 items-end">
<div className="lg:col-span-5 space-y-3">
<span className="text-[11px] font-black tracking-widest text-[#EC167F] uppercase block">
{websiteConfig.portfolioEyebrow}
</span>
<h2 className="text-2xl sm:text-3xl font-black text-slate-900 tracking-tight">
{websiteConfig.portfolioTitle}
</h2>
<p className="text-xs text-slate-600 font-medium leading-relaxed">
{websiteConfig.portfolioSubtitle}
</p>
<div className="pt-2">
<button
type="button"
onClick={() => triggerToast('Membuka seluruh galeri foto portofolio!')}
className="px-5 py-2.5 bg-[#EC167F] hover:bg-[#D41270] text-white font-extrabold text-xs rounded-xl shadow-xs transition-all cursor-pointer inline-flex items-center gap-1.5"
>
<span>Lihat Semua Galeri</span>
<ArrowRight className="w-3.5 h-3.5" />
</button>
</div>
</div>
{/* Portfolio Showcase Grid */}
<div className="lg:col-span-7 grid grid-cols-1 sm:grid-cols-12 gap-3">
{/* Main Featured Photo */}
<div className="sm:col-span-6 h-72 sm:h-80 rounded-2xl overflow-hidden border-2 border-white shadow-md relative group">
<img
src={websiteConfig.featuredPortfolioImage}
alt="Featured Look"
referrerPolicy="no-referrer"
className="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
/>
</div>
{/* 2x2 Subgrid */}
<div className="sm:col-span-6 grid grid-cols-2 gap-3">
{websiteConfig.portfolioGrid.map((imgItem, idx) => (
<div key={imgItem.id} className="relative h-36 sm:h-38 rounded-2xl overflow-hidden border-2 border-white shadow-2xs group">
<img
src={imgItem.url}
alt={imgItem.title}
referrerPolicy="no-referrer"
className="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
/>
{idx === 3 && (
<div className="absolute inset-0 bg-slate-950/60 backdrop-blur-xs flex flex-col items-center justify-center text-white p-2 text-center cursor-pointer">
<span className="text-base font-black">+25</span>
<span className="text-[10px] font-bold">Lihat Semua</span>
</div>
)}
</div>
))}
</div>
</div>
</div>
</div>
</section>
{/* 5. TESTIMONIALS SECTION */}
<section id="testimoni" className="py-16 bg-white">
<div className="max-w-6xl mx-auto px-4 sm:px-6 space-y-10">
<div className="text-center space-y-2 max-w-xl mx-auto">
<span className="text-[11px] font-black tracking-widest text-[#EC167F] uppercase block">
{websiteConfig.testimonialsEyebrow}
</span>
<h2 className="text-2xl sm:text-3xl font-black text-slate-900 tracking-tight">
{websiteConfig.testimonialsTitle}
</h2>
<p className="text-xs text-slate-500 font-medium">
{websiteConfig.testimonialsSubtitle}
</p>
</div>
{/* Testimonials 3 Grid */}
<div className="grid grid-cols-1 md:grid-cols-3 gap-5">
{websiteConfig.testimonials.map((t) => (
<div key={t.id} className="p-6 bg-[#FAF5F6] rounded-2xl border border-rose-100/80 shadow-2xs flex flex-col justify-between space-y-4">
<div className="space-y-3">
<span className="text-2xl font-serif text-[#EC167F] block">“</span>
<p className="text-xs text-slate-700 font-normal leading-relaxed">
{t.text}
</p>
</div>
<div className="flex items-center gap-3 pt-3 border-t border-rose-100/80">
<img
src={t.avatar}
alt={t.name}
className="w-9 h-9 rounded-full object-cover border border-rose-200"
/>
<div>
<h4 className="text-xs font-black text-slate-900">{t.name}</h4>
<span className="text-[10px] font-bold text-slate-400 block">{t.role}</span>
</div>
</div>
</div>
))}
</div>
{/* Dots Pagination */}
<div className="flex justify-center items-center gap-2 pt-2">
<span className="w-6 h-2 rounded-full bg-[#EC167F]"></span>
<span className="w-2 h-2 rounded-full bg-rose-200"></span>
<span className="w-2 h-2 rounded-full bg-rose-200"></span>
</div>
</div>
</section>
{/* 6. SIAP TAMPIL MEMUKAU BANNER */}
<section className="py-12 px-4 sm:px-6">
<div className="max-w-5xl mx-auto bg-gradient-to-r from-rose-100 via-pink-100 to-rose-50 rounded-3xl p-8 sm:p-12 border border-rose-200/80 shadow-sm relative overflow-hidden flex flex-col sm:flex-row items-center justify-between gap-6">
<div className="space-y-3 max-w-md z-10">
<h2 className="text-2xl sm:text-3xl font-black text-slate-900 tracking-tight">
{websiteConfig.bannerTitle}
</h2>
<p className="text-xs sm:text-sm text-slate-600 font-normal">
{websiteConfig.bannerSubtitle}
</p>
<div className="pt-2">
<button
type="button"
onClick={onNavigateToPublicForm}
className="px-6 py-3 bg-[#EC167F] hover:bg-[#D41270] active:scale-95 text-white font-extrabold text-xs rounded-xl shadow-md transition-all cursor-pointer flex items-center gap-2"
>
<Calendar className="w-4 h-4" />
<span>{websiteConfig.bannerCta}</span>
</button>
</div>
</div>
{/* Decorative Image */}
<div className="w-full sm:w-72 h-44 rounded-2xl overflow-hidden shadow-md border-2 border-white z-10 shrink-0">
<img
src={websiteConfig.bannerBgImage}
alt="Cosmetics brushes"
className="w-full h-full object-cover"
/>
</div>
</div>
</section>
{/* 7. FOOTER */}
<footer id="kontak" className="bg-white border-t border-rose-100 pt-12 pb-8 text-xs text-slate-600">
<div className="max-w-6xl mx-auto px-4 sm:px-6 grid grid-cols-1 md:grid-cols-12 gap-8 pb-10 border-b border-rose-100">
{/* Col 1: Brand Info */}
<div className="md:col-span-4 space-y-4">
<div className="flex items-center gap-2">
<span className="font-serif italic font-extrabold text-2xl text-[#EC167F]">
Glamour
</span>
<span className="text-[10px] font-extrabold tracking-widest text-slate-400 block -ml-1 mt-3 uppercase">
{websiteConfig.brandSubtitle}
</span>
</div>
<p className="text-xs text-slate-500 leading-relaxed">
Makeup profesional untuk setiap momen spesial Anda. Tampil percaya diri, cantik, dan berkesan.
</p>
<div className="flex items-center gap-2 pt-1 text-slate-400">
<a href="#instagram" className="p-2 rounded-full bg-rose-50 hover:text-[#EC167F] transition-colors"><Instagram className="w-4 h-4" /></a>
<a href="#phone" className="p-2 rounded-full bg-rose-50 hover:text-[#EC167F] transition-colors"><Phone className="w-4 h-4" /></a>
<a href="#youtube" className="p-2 rounded-full bg-rose-50 hover:text-[#EC167F] transition-colors"><Youtube className="w-4 h-4" /></a>
</div>
</div>
{/* Col 2: Navigasi */}
<div className="md:col-span-2 space-y-3">
<h4 className="font-extrabold text-slate-900 text-xs">Navigasi</h4>
<ul className="space-y-2 text-slate-500">
<li><a href="#beranda" className="hover:text-[#EC167F]">Beranda</a></li>
<li><a href="#tentang" className="hover:text-[#EC167F]">Tentang Saya</a></li>
<li><a href="#layanan" className="hover:text-[#EC167F]">Layanan</a></li>
<li><a href="#galeri" className="hover:text-[#EC167F]">Galeri</a></li>
<li><a href="#testimoni" className="hover:text-[#EC167F]">Testimoni</a></li>
<li><a href="#kontak" className="hover:text-[#EC167F]">Kontak</a></li>
</ul>
</div>
{/* Col 3: Layanan */}
<div className="md:col-span-3 space-y-3">
<h4 className="font-extrabold text-slate-900 text-xs">Layanan</h4>
<ul className="space-y-2 text-slate-500">
<li>Makeup Pengantin</li>
<li>Makeup Wisuda</li>
<li>Makeup Photoshoot</li>
<li>Makeup Event</li>
<li>Kursus Makeup Private</li>
</ul>
</div>
{/* Col 4: Newsletter */}
<div className="md:col-span-3 space-y-3">
<h4 className="font-extrabold text-slate-900 text-xs">Newsletter</h4>
<p className="text-[11px] text-slate-500">Dapatkan tips makeup dan info promo menarik dari kami.</p>
<div className="space-y-2">
<input
type="email"
placeholder="Email Anda"
className="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:outline-none"
/>
<button
type="button"
onClick={() => triggerToast('Terima kasih telah berlangganan newsletter!')}
className="w-full py-2 bg-[#EC167F] hover:bg-[#D41270] text-white font-extrabold text-xs rounded-xl shadow-2xs cursor-pointer"
>
Berlangganan
</button>
</div>
</div>
</div>
<div className="max-w-6xl mx-auto px-4 sm:px-6 pt-6 flex flex-col sm:flex-row items-center justify-between text-[11px] text-slate-400 font-medium">
<span>© 2025 Glamour Makeup Artist. All rights reserved.</span>
<span>Powered by <strong className="text-[#EC167F]">MuaKita</strong></span>
</div>
</footer>
</div>
);
};
return (
<div className="space-y-6 animate-in fade-in duration-300">
{/* 1. TOP PAGE HEADER BAR */}
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-4 pb-1">
<div>
<h1 className="text-2xl font-black text-slate-900 tracking-tight">Website Builder</h1>
<p className="text-xs font-medium text-slate-500">Kelola dan kustomisasi tampilan website MUA profesional Anda</p>
</div>
{/* Top Right Action Buttons */}
<div className="flex items-center gap-2 shrink-0">
<button
type="button"
onClick={() => setIsPreviewModalOpen(true)}
className="px-4 py-2 bg-white hover:bg-slate-50 text-slate-700 font-extrabold text-xs rounded-xl border border-slate-200/90 shadow-2xs transition-all flex items-center gap-2 cursor-pointer"
>
<Eye className="w-4 h-4 text-[#EC167F]" />
<span>Preview Website</span>
</button>
<div className="relative">
<button
type="button"
onClick={() => setShowPublishDropdown(!showPublishDropdown)}
className="px-4 py-2 bg-[#EC167F] hover:bg-[#D41270] text-white font-extrabold text-xs rounded-xl shadow-xs transition-all flex items-center gap-1.5 cursor-pointer"
>
<Zap className="w-4 h-4 fill-white" />
<span>Publikasikan Website</span>
<ChevronDown className="w-3.5 h-3.5 ml-0.5" />
</button>
{showPublishDropdown && (
<div className="absolute right-0 top-11 w-56 bg-white border border-slate-200 rounded-2xl shadow-xl p-1.5 z-50 text-xs">
<button
type="button"
onClick={handlePublish}
className="w-full text-left px-3 py-2 rounded-xl hover:bg-pink-50 text-slate-800 font-extrabold flex items-center gap-2 cursor-pointer"
>
<CheckCircle2 className="w-4 h-4 text-[#EC167F]" />
<span>Publikasikan Sekarang</span>
</button>
<button
type="button"
onClick={() => {
triggerToast('Draft disimpan!');
setShowPublishDropdown(false);
}}
className="w-full text-left px-3 py-2 rounded-xl hover:bg-slate-50 text-slate-700 font-medium flex items-center gap-2 cursor-pointer"
>
<Save className="w-4 h-4 text-slate-400" />
<span>Simpan Perubahan ke Draft</span>
</button>
</div>
)}
</div>
</div>
</div>
{/* SUB-SECTION TAB SELECTOR STRIP */}
<div className="flex items-center gap-1 bg-slate-100/80 p-1 rounded-2xl overflow-x-auto custom-scrollbar text-xs font-bold text-slate-600">
{[
{ id: 'dashboard', label: 'Dashboard Website', icon: LayoutGrid },
{ id: 'preview', label: 'Preview Web', icon: Eye },
{ id: 'edit', label: 'Edit Halaman', icon: Edit3 },
{ id: 'konten', label: 'Kelola Konten', icon: FileText },
{ id: 'seo', label: 'SEO & Pengaturan', icon: Sliders },
{ id: 'domain', label: 'Domain', icon: Globe },
{ id: 'analytics', label: 'Analytics', icon: BarChart3 }
].map((item) => {
const Icon = item.icon;
const isActive = subSection === item.id;
return (
<button
key={item.id}
type="button"
onClick={() => handleSubSectionChange(item.id)}
className={`px-3.5 py-2 rounded-xl transition-all shrink-0 flex items-center gap-1.5 cursor-pointer ${
isActive
? 'bg-white text-[#EC167F] font-extrabold shadow-2xs'
: 'hover:text-slate-900 hover:bg-white/60'
}`}
>
<Icon className="w-3.5 h-3.5" />
<span>{item.label}</span>
</button>
);
})}
</div>
{/* 2. MAIN DASHBOARD OVERVIEW SECTION */}
{subSection === 'dashboard' && (
<div className="space-y-6">
{/* TOP 3 GRID CARDS (Status + Live Hero Preview + Analytics) */}
<div className="grid grid-cols-1 lg:grid-cols-12 gap-5 items-stretch">
{/* CARD 1: Status Website */}
<div className="lg:col-span-3 bg-white p-5 rounded-3xl border border-slate-200/80 shadow-2xs flex flex-col justify-between space-y-4">
<div>
<span className="text-xs font-extrabold text-slate-700 block mb-2">Status Website</span>
<div className="flex items-center gap-2 mb-3">
<span className="px-3 py-1 bg-emerald-50 text-emerald-600 border border-emerald-200/80 rounded-full text-xs font-extrabold flex items-center gap-1.5 shadow-2xs">
<span className="w-2 h-2 rounded-full bg-emerald-500 animate-pulse"></span>
<span>Online</span>
</span>
</div>
<div className="space-y-1">
<a
href={fullDomainUrl}
target="_blank"
rel="noreferrer"
className="text-xs font-bold text-[#EC167F] hover:underline flex items-center gap-1 break-all"
>
<span>{fullDomainUrl}</span>
<ExternalLink className="w-3.5 h-3.5 shrink-0" />
</a>
<button
type="button"
onClick={handleCopyLink}
className="text-[10px] font-extrabold text-slate-400 hover:text-slate-600 flex items-center gap-1 transition-colors cursor-pointer pt-0.5"
>
{copiedLink ? <Check className="w-3 h-3 text-emerald-600" /> : <Copy className="w-3 h-3" />}
<span>{copiedLink ? 'Link Tersalin' : 'Salin Alamat Website'}</span>
</button>
</div>
</div>
<div className="pt-3 border-t border-slate-100 text-[11px] text-slate-400 font-medium">
Terakhir diperbarui:
<span className="block font-bold text-slate-600">{websiteConfig.lastUpdated}</span>
</div>
</div>
{/* CARD 2: Interactive Live Website Preview Mockup Matching Image */}
<div className="lg:col-span-5 bg-[#FAF5F6] rounded-3xl overflow-hidden shadow-md relative group flex flex-col justify-between border border-rose-200">
{/* Mockup Header Bar */}
<div className="bg-white px-4 py-2.5 flex items-center justify-between border-b border-rose-100 text-slate-800">
<div className="flex items-center gap-2">
<span className="w-2.5 h-2.5 rounded-full bg-rose-400"></span>
<span className="w-2.5 h-2.5 rounded-full bg-amber-400"></span>
<span className="w-2.5 h-2.5 rounded-full bg-emerald-400"></span>
<span className="font-serif italic font-extrabold text-xs text-[#EC167F] ml-1">{websiteConfig.studioName}</span>
</div>
<div className="hidden sm:flex items-center gap-2 text-[10px] font-medium text-slate-500">
<span className="text-[#EC167F] font-bold">Beranda</span>
<span>Tentang</span>
<span>Layanan</span>
<span>Galeri</span>
</div>
<button
type="button"
onClick={onNavigateToPublicForm}
className="px-2.5 py-1 bg-[#EC167F] text-white text-[10px] font-extrabold rounded-full cursor-pointer hover:bg-[#D41270]"
>
Booking Now
</button>
</div>
{/* Hero Banner Visual */}
<div className="relative p-6 flex-1 flex items-center justify-between gap-4">
<div className="space-y-2 max-w-[210px] z-10">
<span className="text-[9px] font-bold text-[#EC167F] uppercase tracking-wider block">
☆ {websiteConfig.heroBadge}
</span>
<h2 className="text-base font-black text-slate-900 leading-snug">
{websiteConfig.heroTitlePrefix}{' '}
<span className="font-serif italic text-[#EC167F]">
{websiteConfig.heroTitleHighlight}
</span>
</h2>
<p className="text-[10px] text-slate-500 line-clamp-2">
{websiteConfig.heroSubtitle}
</p>
<div className="pt-1">
<button
type="button"
onClick={() => setIsPreviewModalOpen(true)}
className="px-3 py-1 bg-[#EC167F] hover:bg-[#D41270] text-white text-[10px] font-extrabold rounded-lg shadow-xs cursor-pointer"
>
Buka Full Website
</button>
</div>
</div>
<div className="w-28 h-36 rounded-2xl overflow-hidden shadow-sm border-2 border-white shrink-0 z-10">
<img
src={websiteConfig.heroImage}
alt="Hero Preview"
className="w-full h-full object-cover"
/>
</div>
</div>
</div>
{/* CARD 3: Performa Website Analytics */}
<div className="lg:col-span-4 bg-white p-5 rounded-3xl border border-slate-200/80 shadow-2xs flex flex-col justify-between space-y-3">
<div className="flex items-center justify-between">
<span className="text-xs font-extrabold text-slate-900">Performa Website</span>
<select
value={timeRange}
onChange={(e) => setTimeRange(e.target.value)}
className="text-[11px] font-bold bg-slate-100 border border-slate-200/80 rounded-xl px-2.5 py-1 text-slate-700 focus:outline-none cursor-pointer"
>
<option value="7_hari">7 Hari Terakhir</option>
<option value="30_hari">30 Hari Terakhir</option>
<option value="3_bulan">3 Bulan Terakhir</option>
</select>
</div>
{/* 3 Metric Metrics */}
<div className="grid grid-cols-3 gap-2 pt-1">
<div>
<span className="text-[10px] font-bold text-slate-400 block">Pengunjung</span>
<span className="text-base font-black text-slate-900 block leading-tight">1.248</span>
<span className="text-[10px] font-black text-emerald-600 flex items-center gap-0.5">
<ArrowUp className="w-2.5 h-2.5" /> 24.5%
</span>
</div>
<div>
<span className="text-[10px] font-bold text-slate-400 block">Reservasi</span>
<span className="text-base font-black text-slate-900 block leading-tight">32</span>
<span className="text-[10px] font-black text-emerald-600 flex items-center gap-0.5">
<ArrowUp className="w-2.5 h-2.5" /> 18.2%
</span>
</div>
<div>
<span className="text-[10px] font-bold text-slate-400 block">Conversion</span>
<span className="text-base font-black text-slate-900 block leading-tight">2.56%</span>
<span className="text-[10px] font-black text-emerald-600 flex items-center gap-0.5">
<ArrowUp className="w-2.5 h-2.5" /> 12.6%
</span>
</div>
</div>
{/* Mini Sparkline SVG Graph */}
<div className="pt-2">
<div className="h-20 w-full relative">
<svg className="w-full h-full overflow-visible" viewBox="0 0 300 70">
<defs>
<linearGradient id="pinkGrad" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stopColor="#EC167F" stopOpacity="0.25" />
<stop offset="100%" stopColor="#EC167F" stopOpacity="0.0" />
</linearGradient>
</defs>
<path
d="M 10 50 L 50 30 L 90 45 L 130 20 L 170 38 L 210 28 L 250 48 L 290 15 L 290 70 L 10 70 Z"
fill="url(#pinkGrad)"
/>
<path
d="M 10 50 L 50 30 L 90 45 L 130 20 L 170 38 L 210 28 L 250 48 L 290 15"
fill="none"
stroke="#EC167F"
strokeWidth="2.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
{[[10,50], [50,30], [90,45], [130,20], [170,38], [210,28], [250,48], [290,15]].map((pt, idx) => (
<circle key={idx} cx={pt[0]} cy={pt[1]} r="3" fill="#EC167F" stroke="#ffffff" strokeWidth="1.5" />
))}
</svg>
</div>
<div className="flex justify-between text-[9px] font-bold text-slate-400 pt-1">
<span>18 Mei</span>
<span>19 Mei</span>
<span>20 Mei</span>
<span>21 Mei</span>
<span>22 Mei</span>
<span>23 Mei</span>
<span>24 Mei</span>
</div>
</div>
</div>
</div>
{/* MIDDLE SECTION: Aksi Cepat */}
<div className="space-y-3">
<h2 className="text-sm font-extrabold text-slate-900">Aksi Cepat</h2>
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3">
{[
{ id: 'edit', title: 'Edit Halaman', desc: 'Atur & kustomisasi section halaman', icon: Edit3, bg: 'bg-pink-100 text-[#EC167F]' },
{ id: 'konten', title: 'Kelola Konten', desc: 'Kelola info kontak, sosial media, & bio', icon: FileText, bg: 'bg-emerald-100 text-emerald-600' },
{ id: 'layanan', title: 'Layanan MUA', desc: 'Atur daftar & harga paket layanan', icon: Sparkles, bg: 'bg-amber-100 text-amber-600' },
{ id: 'seo', title: 'SEO Google', desc: 'Optimasi kata kunci pencarian', icon: Search, bg: 'bg-blue-100 text-blue-600' },
{ id: 'domain', title: 'Domain Website', desc: 'Kelola subdomain & domain kustom', icon: Globe, bg: 'bg-purple-100 text-purple-600' },
{ id: 'preview', title: 'Preview Website', desc: 'Lihat tampilan langsung di desktop & mobile', icon: Eye, bg: 'bg-rose-100 text-rose-600' },
].map((act) => {
const Icon = act.icon;
return (
<button
key={act.id}
type="button"
onClick={() => {
if (act.id === 'preview') setIsPreviewModalOpen(true);
else if (act.id === 'layanan') setActiveTab('layanan');
else handleSubSectionChange(act.id);
}}
className="p-3.5 bg-white rounded-2xl border border-slate-200/80 shadow-2xs hover:shadow-md hover:border-pink-200 transition-all text-left group cursor-pointer flex flex-col justify-between"
>
<div className="flex items-center justify-between mb-3">
<div className={`w-9 h-9 rounded-xl ${act.bg} flex items-center justify-center font-bold`}>
<Icon className="w-4 h-4" />
</div>
<ChevronRight className="w-4 h-4 text-slate-300 group-hover:text-[#EC167F] transition-colors" />
</div>
<div>
<h3 className="text-xs font-extrabold text-slate-900 group-hover:text-[#EC167F] transition-colors">
{act.title}
</h3>
<p className="text-[10px] text-slate-400 font-medium leading-relaxed mt-0.5 line-clamp-2">
{act.desc}
</p>
</div>
</button>
);
})}
</div>
</div>
{/* BOTTOM SECTION: Official Template Status Banner */}
<div className="bg-gradient-to-r from-rose-50 via-white to-pink-50 p-6 rounded-3xl border border-rose-200/80 shadow-2xs flex flex-col md:flex-row items-center justify-between gap-6">
<div className="flex items-start gap-4">
<div className="w-12 h-12 rounded-2xl bg-[#EC167F] text-white flex items-center justify-center shrink-0 shadow-md shadow-pink-500/20 font-bold">
<Sparkles className="w-6 h-6" />
</div>
<div className="space-y-1">
<div className="flex items-center gap-2">
<h2 className="text-sm font-black text-slate-900">Template Resmi MUA Kita (Official)</h2>
<span className="px-2.5 py-0.5 bg-emerald-100 text-emerald-700 text-[10px] font-black rounded-full border border-emerald-200">
Aktif & Siap Pakai
</span>
</div>
<p className="text-xs text-slate-600 leading-relaxed max-w-xl">
Website Anda menggunakan desain standar resmi <strong>Glamour Beauty & Elegant</strong> yang dirancang khusus untuk memamerkan portofolio riasan MUA, rincian layanan, testimoni klien, dan tombol reservasi online secara otomatis.
</p>
</div>
</div>
<button
type="button"
onClick={() => handleSubSectionChange('edit')}
className="px-5 py-2.5 bg-[#EC167F] hover:bg-[#D41270] text-white font-extrabold text-xs rounded-xl shadow-xs transition-all shrink-0 cursor-pointer flex items-center gap-2"
>
<Edit3 className="w-4 h-4" />
<span>Edit Isi Website</span>
</button>
</div>
</div>
)}
{/* 3. OWNER PREVIEW WEB SUB-VIEW (FULL WEBSITE VIEW LIKE IMAGE) */}
{subSection === 'preview' && (
<div className="space-y-4 animate-in fade-in duration-300">
{/* Top Control Bar for Owner */}
<div className="bg-slate-900 text-white p-4 sm:p-5 rounded-3xl shadow-xl flex flex-col sm:flex-row items-center justify-between gap-4 border border-slate-800">
<div className="flex items-center gap-3">
<div className="w-10 h-10 rounded-2xl bg-[#EC167F] flex items-center justify-center font-bold shrink-0 shadow-md shadow-pink-500/30">
<Globe className="w-5 h-5 text-white" />
</div>
<div>
<div className="flex items-center gap-2">
<h2 className="text-sm font-black text-white">Preview Web Website Builder Owner</h2>
<span className="px-2 py-0.5 bg-emerald-500/20 text-emerald-400 border border-emerald-500/30 text-[10px] font-extrabold rounded-full">
Live View Mode
</span>
</div>
<p className="text-xs text-slate-400 font-medium">Tampilan penuh website MUA Anda persis seperti yang dilihat oleh calon klien</p>
</div>
</div>
{/* Viewport Device Controls & Actions */}
<div className="flex items-center gap-2 flex-wrap">
<div className="flex items-center gap-1 bg-slate-800 p-1 rounded-2xl border border-slate-700/80 text-xs">
<button
type="button"
onClick={() => setPreviewDevice('desktop')}
className={`px-3 py-1.5 rounded-xl font-extrabold flex items-center gap-1.5 transition-all cursor-pointer ${
previewDevice === 'desktop'
? 'bg-[#EC167F] text-white shadow-xs'
: 'text-slate-400 hover:text-white hover:bg-slate-700/50'
}`}
>
<Monitor className="w-3.5 h-3.5" />
<span>Desktop</span>
</button>
<button
type="button"
onClick={() => setPreviewDevice('mobile')}
className={`px-3 py-1.5 rounded-xl font-extrabold flex items-center gap-1.5 transition-all cursor-pointer ${
previewDevice === 'mobile'
? 'bg-[#EC167F] text-white shadow-xs'
: 'text-slate-400 hover:text-white hover:bg-slate-700/50'
}`}
>
<Smartphone className="w-3.5 h-3.5" />
<span>Mobile</span>
</button>
</div>
<button
type="button"
onClick={handleCopyLink}
className="px-3.5 py-2 bg-slate-800 hover:bg-slate-700 text-slate-200 font-extrabold text-xs rounded-xl border border-slate-700 transition-colors flex items-center gap-1.5 cursor-pointer"
>
{copiedLink ? <Check className="w-3.5 h-3.5 text-emerald-400" /> : <Copy className="w-3.5 h-3.5 text-slate-400" />}
<span>{copiedLink ? 'Tersalin' : 'Salin Link'}</span>
</button>
<button
type="button"
onClick={() => handleSubSectionChange('edit')}
className="px-4 py-2 bg-[#EC167F] hover:bg-[#D41270] text-white font-extrabold text-xs rounded-xl shadow-xs transition-all flex items-center gap-1.5 cursor-pointer"
>
<Edit3 className="w-3.5 h-3.5" />
<span>Edit Isi Website</span>
</button>
</div>
</div>
{/* Simulated Browser Frame Window */}
<div className="bg-slate-200/90 p-2 sm:p-4 rounded-3xl border border-slate-300/80 shadow-inner flex flex-col items-center">
{/* Browser Address Bar */}
<div className="w-full bg-slate-100 rounded-t-2xl p-2.5 border-b border-slate-200 flex items-center justify-between gap-3 text-xs">
<div className="flex items-center gap-2">
<div className="flex items-center gap-1.5 px-2">
<span className="w-2.5 h-2.5 rounded-full bg-rose-400"></span>
<span className="w-2.5 h-2.5 rounded-full bg-amber-400"></span>
<span className="w-2.5 h-2.5 rounded-full bg-emerald-400"></span>
</div>
<div className="px-3 py-1 bg-white border border-slate-200 rounded-xl font-mono text-[11px] text-slate-600 flex items-center gap-2 shadow-2xs">
<Globe className="w-3 h-3 text-[#EC167F]" />
<span>{fullDomainUrl}</span>
</div>
</div>
<div className="flex items-center gap-2 text-slate-500 font-bold text-[11px]">
<button
type="button"
onClick={() => triggerToast('Refreshing preview...')}
className="p-1 hover:bg-slate-200 rounded-lg transition-colors cursor-pointer"
>
<Clock className="w-3.5 h-3.5" />
</button>
<button
type="button"
onClick={() => setIsPreviewModalOpen(true)}
className="px-2.5 py-1 bg-white hover:bg-slate-50 border border-slate-200 rounded-lg text-slate-700 flex items-center gap-1 cursor-pointer"
>
<Eye className="w-3 h-3 text-[#EC167F]" />
<span>Full Modal</span>
</button>
</div>
</div>
{/* Simulated Device Canvas Container */}
<div className="w-full flex justify-center py-4 overflow-x-auto custom-scrollbar">
<div className={`transition-all duration-300 bg-white shadow-2xl border border-slate-200/80 overflow-hidden ${
previewDevice === 'mobile'
? 'w-[390px] rounded-[40px] border-8 border-slate-800 my-4 shadow-pink-900/10'
: 'w-full rounded-b-2xl'
}`}>
{/* Mobile Top Notch */}
{previewDevice === 'mobile' && (
<div className="bg-slate-800 h-6 w-full flex justify-center items-center">
<div className="w-24 h-3.5 bg-slate-900 rounded-full"></div>
</div>
)}
{/* Render Full Website Content */}
{renderPublicWebsiteContent()}
</div>
</div>
</div>
</div>
)}
{/* 4. EDIT HALAMAN SUB-VIEW (FULL LIVE MANAGEMENT WITH SPLIT SCREEN) */}
{subSection === 'edit' && (
<div className="space-y-5 animate-in fade-in duration-300">
{/* Top Owner Editor Header */}
<div className="bg-white p-5 rounded-3xl border border-slate-200/80 shadow-2xs flex flex-col md:flex-row md:items-center justify-between gap-4">
<div className="flex items-center gap-3">
<div className="w-10 h-10 rounded-2xl bg-[#EC167F] text-white flex items-center justify-center font-bold shrink-0 shadow-md shadow-pink-500/20">
<Edit3 className="w-5 h-5" />
</div>
<div>
<div className="flex items-center gap-2 flex-wrap">
<h2 className="text-base font-extrabold text-slate-900">Live Web Builder Owner Studio</h2>
<span className="px-2.5 py-0.5 bg-emerald-100 text-emerald-700 text-[10px] font-black rounded-full border border-emerald-200 flex items-center gap-1">
<span className="w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"></span>
<span>Tersambung Real-time</span>
</span>
</div>
<p className="text-xs text-slate-500 font-medium mt-0.5">
Setiap ketikan dan perubahan gambar langsung ter-sync ke domain <strong>{fullDomainUrl}</strong>
</p>
</div>
</div>
{/* Split Screen Toggle & Action Buttons */}
<div className="flex items-center gap-2 flex-wrap">
<button
type="button"
onClick={() => setIsSplitView(!isSplitView)}
className={`px-3.5 py-2 font-extrabold text-xs rounded-xl border transition-all cursor-pointer flex items-center gap-1.5 ${
isSplitView
? 'bg-slate-900 text-white border-slate-900 shadow-2xs'
: 'bg-white text-slate-700 border-slate-200 hover:bg-slate-50'
}`}
>
<LayoutGrid className="w-3.5 h-3.5 text-[#EC167F]" />
<span>{isSplitView ? 'Split Screen ON' : 'Tampilkan Live Preview'}</span>
</button>
<button
type="button"
onClick={() => setIsPreviewModalOpen(true)}
className="px-3.5 py-2 bg-rose-50 hover:bg-rose-100 text-[#EC167F] font-extrabold text-xs rounded-xl border border-rose-200 transition-colors flex items-center gap-1.5 cursor-pointer"
>
<Eye className="w-3.5 h-3.5" />
<span>Modal Preview</span>
</button>
<button
type="button"
onClick={() => triggerToast('Seluruh kustomisasi website berhasil disimpan!')}
className="px-4 py-2 bg-[#EC167F] hover:bg-[#D41270] text-white font-extrabold text-xs rounded-xl shadow-xs transition-all flex items-center gap-1.5 cursor-pointer"
>
<Save className="w-3.5 h-3.5" />
<span>Simpan Website</span>
</button>
</div>
</div>
{/* Section Selector Sub-Tabs */}
<div className="bg-slate-100/90 p-1.5 rounded-2xl flex items-center gap-1 overflow-x-auto custom-scrollbar text-xs font-bold text-slate-600">
{[
{ id: 'hero', label: '1. Hero Banner', icon: Sparkles },
{ id: 'layanan', label: '2. Layanan MUA', icon: Award },
{ id: 'portfolio', label: '3. Galeri Portofolio', icon: FileText },
{ id: 'testimoni', label: '4. Testimoni Klien', icon: Users },
{ id: 'cta', label: '5. Banner CTA', icon: Heart },
{ id: 'footer', label: '6. Footer & Kontak', icon: Globe },
].map((tab) => {
const Icon = tab.icon;
const isActive = activeEditorTab === tab.id;
return (
<button
key={tab.id}
type="button"
onClick={() => setActiveEditorTab(tab.id as any)}
className={`px-3.5 py-2 rounded-xl transition-all whitespace-nowrap cursor-pointer flex items-center gap-1.5 ${
isActive
? 'bg-white text-[#EC167F] shadow-xs font-extrabold'
: 'hover:text-slate-900 hover:bg-slate-200/50'
}`}
>
<Icon className={`w-3.5 h-3.5 ${isActive ? 'text-[#EC167F]' : 'text-slate-400'}`} />
<span>{tab.label}</span>
</button>
);
})}
</div>
{/* MAIN EDITOR CONTAINER (SPLIT OR FULL WIDTH) */}
<div className={`grid grid-cols-1 ${isSplitView ? 'lg:grid-cols-12 gap-6' : 'gap-6'}`}>
{/* LEFT FORM COLUMN */}
<div className={`bg-white p-6 rounded-3xl border border-slate-200/80 shadow-2xs space-y-5 ${
isSplitView ? 'lg:col-span-6' : 'w-full'
}`}>
{/* TAB 1: HERO BANNER */}
{activeEditorTab === 'hero' && (
<div className="space-y-4 text-xs">
<div className="border-b border-slate-100 pb-3">
<h3 className="font-extrabold text-sm text-slate-900">Kustomisasi Hero Banner</h3>
<p className="text-slate-500 text-[11px]">Bagian paling atas yang pertama kali dilihat oleh calon klien MUA.</p>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3.5">
<div>
<label className="block font-bold text-slate-700 mb-1">Nama Studio / Brand MUA</label>
<input
type="text"
value={websiteConfig.studioName}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, studioName: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50 font-bold focus:bg-white focus:border-[#EC167F] outline-none"
/>
</div>
<div>
<label className="block font-bold text-slate-700 mb-1">Badge Atas Hero</label>
<input
type="text"
value={websiteConfig.heroBadge}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, heroBadge: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50 font-bold focus:bg-white focus:border-[#EC167F] outline-none"
/>
</div>
<div className="sm:col-span-2">
<label className="block font-bold text-slate-700 mb-1">Judul Utama Hero (Prefix)</label>
<input
type="text"
value={websiteConfig.heroTitlePrefix}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, heroTitlePrefix: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50 font-bold focus:bg-white focus:border-[#EC167F] outline-none"
/>
</div>
<div>
<label className="block font-bold text-slate-700 mb-1">Kata Highlight (Cursive Pink)</label>
<input
type="text"
value={websiteConfig.heroTitleHighlight}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, heroTitleHighlight: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50 font-bold text-[#EC167F] focus:bg-white focus:border-[#EC167F] outline-none"
/>
</div>
<div>
<label className="block font-bold text-slate-700 mb-1">Tombol Utama CTA</label>
<input
type="text"
value={websiteConfig.primaryCtaText}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, primaryCtaText: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50 font-bold focus:bg-white focus:border-[#EC167F] outline-none"
/>
</div>
<div className="sm:col-span-2">
<label className="block font-bold text-slate-700 mb-1">Deskripsi Singkat Subtitle Hero</label>
<textarea
rows={3}
value={websiteConfig.heroSubtitle}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, heroSubtitle: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50 focus:bg-white focus:border-[#EC167F] outline-none leading-relaxed"
/>
</div>
<div className="sm:col-span-2 space-y-2">
<label className="block font-bold text-slate-700">URL Foto Model Hero Utama</label>
<div className="flex gap-2">
<input
type="text"
value={websiteConfig.heroImage}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, heroImage: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50 font-mono text-[11px] focus:bg-white focus:border-[#EC167F] outline-none"
/>
</div>
<div className="flex items-center gap-2 pt-1">
<span className="text-[10px] font-bold text-slate-400">Pilihan Gambar Preset:</span>
<button
type="button"
onClick={() => setWebsiteConfig({ ...websiteConfig, heroImage: 'https://images.unsplash.com/photo-1519741497674-611481863552?auto=format&fit=crop&q=80&w=1200' })}
className="px-2 py-1 bg-slate-100 hover:bg-pink-100 hover:text-[#EC167F] rounded-lg text-[10px] font-bold cursor-pointer"
>
Soft Bridal
</button>
<button
type="button"
onClick={() => setWebsiteConfig({ ...websiteConfig, heroImage: 'https://images.unsplash.com/photo-1522337360788-8b13dee7a37e?auto=format&fit=crop&q=80&w=1200' })}
className="px-2 py-1 bg-slate-100 hover:bg-pink-100 hover:text-[#EC167F] rounded-lg text-[10px] font-bold cursor-pointer"
>
Glamour Studio
</button>
</div>
</div>
</div>
</div>
)}
{/* TAB 2: LAYANAN MUA */}
{activeEditorTab === 'layanan' && (
<div className="space-y-4 text-xs">
<div className="flex items-center justify-between border-b border-slate-100 pb-3">
<div>
<h3 className="font-extrabold text-sm text-slate-900">Kustomisasi Layanan MUA</h3>
<p className="text-slate-500 text-[11px]">Atur judul paket dan deskripsi layanan riasan Anda.</p>
</div>
<button
type="button"
onClick={() => {
const newService = {
id: `s_${Date.now()}`,
title: 'Layanan Baru MUA',
desc: 'Deskripsi singkat layanan makeup terbaru Anda.',
icon: 'Sparkles'
};
setWebsiteConfig({ ...websiteConfig, services: [...websiteConfig.services, newService] });
triggerToast('Layanan baru berhasil ditambahkan!');
}}
className="px-3 py-1.5 bg-[#EC167F] text-white font-extrabold text-[11px] rounded-xl cursor-pointer flex items-center gap-1"
>
<Plus className="w-3.5 h-3.5" />
<span>Tambah Layanan</span>
</button>
</div>
<div className="space-y-3">
{websiteConfig.services.map((srv, idx) => (
<div key={srv.id} className="p-3.5 border border-slate-200/80 rounded-2xl bg-slate-50/50 space-y-2">
<div className="flex items-center justify-between">
<span className="font-extrabold text-[#EC167F]">Paket Layanan #{idx + 1}</span>
{websiteConfig.services.length > 1 && (
<button
type="button"
onClick={() => {
const filtered = websiteConfig.services.filter(s => s.id !== srv.id);
setWebsiteConfig({ ...websiteConfig, services: filtered });
}}
className="text-rose-500 hover:underline font-bold text-[10px] cursor-pointer"
>
Hapus
</button>
)}
</div>
<div>
<label className="block text-[11px] font-bold text-slate-600 mb-1">Nama Layanan</label>
<input
type="text"
value={srv.title}
onChange={(e) => {
const updated = [...websiteConfig.services];
updated[idx].title = e.target.value;
setWebsiteConfig({ ...websiteConfig, services: updated });
}}
className="w-full p-2 border rounded-xl bg-white font-bold"
/>
</div>
<div>
<label className="block text-[11px] font-bold text-slate-600 mb-1">Deskripsi Singkat Paket</label>
<textarea
rows={2}
value={srv.desc}
onChange={(e) => {
const updated = [...websiteConfig.services];
updated[idx].desc = e.target.value;
setWebsiteConfig({ ...websiteConfig, services: updated });
}}
className="w-full p-2 border rounded-xl bg-white"
/>
</div>
</div>
))}
</div>
</div>
)}
{/* TAB 3: PORTOFOLIO */}
{activeEditorTab === 'portfolio' && (
<div className="space-y-4 text-xs">
<div className="flex items-center justify-between border-b border-slate-100 pb-3">
<div>
<h3 className="font-extrabold text-sm text-slate-900">Kelola Galeri Portofolio</h3>
<p className="text-slate-500 text-[11px]">Upload dan ubah foto hasil karya riasan terbaik Anda.</p>
</div>
<button
type="button"
onClick={() => {
const newP = {
id: `p_${Date.now()}`,
url: 'https://images.unsplash.com/photo-1519741497674-611481863552?auto=format&fit=crop&q=80&w=600',
title: 'Karya Terbaru MUA'
};
setWebsiteConfig({ ...websiteConfig, portfolioGrid: [...websiteConfig.portfolioGrid, newP] });
triggerToast('Foto portofolio baru ditambahkan!');
}}
className="px-3 py-1.5 bg-[#EC167F] text-white font-extrabold text-[11px] rounded-xl cursor-pointer flex items-center gap-1"
>
<Plus className="w-3.5 h-3.5" />
<span>Tambah Foto</span>
</button>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
{websiteConfig.portfolioGrid.map((p, idx) => (
<div key={p.id} className="p-3 border border-slate-200/80 rounded-2xl bg-slate-50/50 space-y-2">
<div className="h-28 bg-slate-200 rounded-xl overflow-hidden relative">
<img src={p.url} alt={p.title} className="w-full h-full object-cover" />
<button
type="button"
onClick={() => {
const updated = websiteConfig.portfolioGrid.filter(item => item.id !== p.id);
setWebsiteConfig({ ...websiteConfig, portfolioGrid: updated });
}}
className="absolute top-1.5 right-1.5 p-1 bg-slate-900/80 text-white rounded-lg text-[9px] font-bold cursor-pointer"
>
Hapus
</button>
</div>
<input
type="text"
value={p.title}
onChange={(e) => {
const updated = [...websiteConfig.portfolioGrid];
updated[idx].title = e.target.value;
setWebsiteConfig({ ...websiteConfig, portfolioGrid: updated });
}}
className="w-full p-2 border rounded-xl bg-white font-bold"
placeholder="Judul Foto"
/>
<input
type="text"
value={p.url}
onChange={(e) => {
const updated = [...websiteConfig.portfolioGrid];
updated[idx].url = e.target.value;
setWebsiteConfig({ ...websiteConfig, portfolioGrid: updated });
}}
className="w-full p-2 border rounded-xl bg-white font-mono text-[10px]"
placeholder="URL Foto"
/>
</div>
))}
</div>
</div>
)}
{/* TAB 4: TESTIMONI KLIEN */}
{activeEditorTab === 'testimoni' && (
<div className="space-y-4 text-xs">
<div className="flex items-center justify-between border-b border-slate-100 pb-3">
<div>
<h3 className="font-extrabold text-sm text-slate-900">Ulasan & Testimoni Klien</h3>
<p className="text-slate-500 text-[11px]">Tampilkan kepuasan pengantin dan klien MUA Anda.</p>
</div>
<button
type="button"
onClick={() => {
const newT = {
id: `t_${Date.now()}`,
text: 'Hasil makeupnya memuaskan sekali dan tahan seharian!',
name: 'Klien MUA Baru',
role: 'Pengantin Bridal',
avatar: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?auto=format&fit=crop&q=80&w=200'
};
setWebsiteConfig({ ...websiteConfig, testimonials: [...websiteConfig.testimonials, newT] });
triggerToast('Testimoni baru ditambahkan!');
}}
className="px-3 py-1.5 bg-[#EC167F] text-white font-extrabold text-[11px] rounded-xl cursor-pointer flex items-center gap-1"
>
<Plus className="w-3.5 h-3.5" />
<span>Tambah Ulasan</span>
</button>
</div>
<div className="space-y-3">
{websiteConfig.testimonials.map((t, idx) => (
<div key={t.id} className="p-3.5 border border-slate-200/80 rounded-2xl bg-slate-50/50 space-y-2">
<div className="grid grid-cols-2 gap-2">
<input
type="text"
value={t.name}
onChange={(e) => {
const updated = [...websiteConfig.testimonials];
updated[idx].name = e.target.value;
setWebsiteConfig({ ...websiteConfig, testimonials: updated });
}}
className="p-2 border rounded-xl bg-white font-bold"
placeholder="Nama Klien"
/>
<input
type="text"
value={t.role}
onChange={(e) => {
const updated = [...websiteConfig.testimonials];
updated[idx].role = e.target.value;
setWebsiteConfig({ ...websiteConfig, testimonials: updated });
}}
className="p-2 border rounded-xl bg-white font-bold text-slate-500"
placeholder="Role Klien"
/>
</div>
<textarea
rows={2}
value={t.text}
onChange={(e) => {
const updated = [...websiteConfig.testimonials];
updated[idx].text = e.target.value;
setWebsiteConfig({ ...websiteConfig, testimonials: updated });
}}
className="w-full p-2 border rounded-xl bg-white leading-relaxed"
placeholder="Tuliskan ulasan ulasan klien"
/>
</div>
))}
</div>
</div>
)}
{/* TAB 5: BANNER CTA */}
{activeEditorTab === 'cta' && (
<div className="space-y-4 text-xs">
<div className="border-b border-slate-100 pb-3">
<h3 className="font-extrabold text-sm text-slate-900">Kustomisasi Banner CTA Booking</h3>
<p className="text-slate-500 text-[11px]">Banner ajakan reservasi jadwal riasan di bagian bawah website.</p>
</div>
<div>
<label className="block font-bold text-slate-700 mb-1">Judul Banner CTA</label>
<input
type="text"
value={websiteConfig.bannerTitle}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, bannerTitle: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50 font-bold focus:bg-white focus:border-[#EC167F] outline-none"
/>
</div>
<div>
<label className="block font-bold text-slate-700 mb-1">Subtitle Banner</label>
<input
type="text"
value={websiteConfig.bannerSubtitle}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, bannerSubtitle: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50 focus:bg-white focus:border-[#EC167F] outline-none"
/>
</div>
</div>
)}
{/* TAB 6: FOOTER & KONTAK */}
{activeEditorTab === 'footer' && (
<div className="space-y-4 text-xs">
<div className="border-b border-slate-100 pb-3">
<h3 className="font-extrabold text-sm text-slate-900">Kelola Informasi Kontak & Sosial Media</h3>
<p className="text-slate-500 text-[11px]">Tampilkan lokasi studio, kontak WA, dan sosial media resmi Anda.</p>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
<div>
<label className="block font-bold text-slate-700 mb-1">Nomor WhatsApp Studio</label>
<input
type="text"
value={websiteConfig.phone}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, phone: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50 font-bold focus:bg-white focus:border-[#EC167F] outline-none"
/>
</div>
<div>
<label className="block font-bold text-slate-700 mb-1">Username Instagram</label>
<input
type="text"
value={websiteConfig.instagram}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, instagram: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50 font-bold focus:bg-white focus:border-[#EC167F] outline-none"
/>
</div>
<div className="sm:col-span-2">
<label className="block font-bold text-slate-700 mb-1">Alamat Lengkap Studio MUA</label>
<input
type="text"
value={websiteConfig.address}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, address: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50 focus:bg-white focus:border-[#EC167F] outline-none"
/>
</div>
</div>
</div>
)}
{/* Save / Status Action Footer */}
<div className="pt-3 border-t border-slate-100 flex items-center justify-between">
<span className="text-[11px] font-bold text-slate-400 flex items-center gap-1">
<Check className="w-3.5 h-3.5 text-emerald-500" />
<span>Perubahan tersimpan otomatis</span>
</span>
<button
type="button"
onClick={() => triggerToast('Seluruh kustomisasi website berhasil disimpan ke server!')}
className="px-5 py-2.5 bg-[#EC167F] hover:bg-[#D41270] text-white font-extrabold text-xs rounded-xl shadow-xs transition-all cursor-pointer flex items-center gap-1.5"
>
<Save className="w-4 h-4" />
<span>Simpan Website</span>
</button>
</div>
</div>
{/* RIGHT LIVE PREVIEW COLUMN (WHEN SPLIT VIEW IS ACTIVE) */}
{isSplitView && (
<div className="lg:col-span-6 space-y-3 sticky top-20">
<div className="bg-slate-900 text-white p-3.5 rounded-2xl flex items-center justify-between text-xs">
<div className="flex items-center gap-2">
<Globe className="w-4 h-4 text-[#EC167F]" />
<span className="font-extrabold text-xs">Live Sync Web Preview Pane</span>
</div>
<div className="flex items-center gap-1 bg-slate-800 p-1 rounded-xl text-[11px]">
<button
type="button"
onClick={() => setEditorDevice('desktop')}
className={`px-2.5 py-1 rounded-lg font-bold cursor-pointer transition-colors ${
editorDevice === 'desktop' ? 'bg-[#EC167F] text-white' : 'text-slate-400 hover:text-white'
}`}
>
Desktop
</button>
<button
type="button"
onClick={() => setEditorDevice('mobile')}
className={`px-2.5 py-1 rounded-lg font-bold cursor-pointer transition-colors ${
editorDevice === 'mobile' ? 'bg-[#EC167F] text-white' : 'text-slate-400 hover:text-white'
}`}
>
Mobile
</button>
</div>
</div>
{/* Simulated Live Frame Container */}
<div className="bg-slate-200/90 p-2 sm:p-3 rounded-3xl border border-slate-300/80 shadow-inner max-h-[750px] overflow-y-auto custom-scrollbar flex justify-center">
<div className={`transition-all duration-300 bg-white shadow-xl overflow-hidden ${
editorDevice === 'mobile'
? 'w-[360px] rounded-[32px] border-4 border-slate-800 my-2'
: 'w-full rounded-2xl'
}`}>
{renderPublicWebsiteContent()}
</div>
</div>
</div>
)}
</div>
</div>
)}
{/* 5. KELOLA KONTEN SUB-VIEW */}
{subSection === 'konten' && (
<div className="bg-white p-6 rounded-3xl border border-slate-200/80 shadow-2xs space-y-5">
<h2 className="text-base font-extrabold text-slate-900">Kelola Informasi Kontak & Lokasi Studio</h2>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4 text-xs">
<div>
<label className="block font-bold text-slate-700 mb-1">Nomor Telepon / WhatsApp</label>
<input
type="text"
value={websiteConfig.phone}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, phone: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50"
/>
</div>
<div>
<label className="block font-bold text-slate-700 mb-1">Username Instagram</label>
<input
type="text"
value={websiteConfig.instagram}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, instagram: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50"
/>
</div>
<div className="sm:col-span-2">
<label className="block font-bold text-slate-700 mb-1">Alamat Lengkap Studio</label>
<input
type="text"
value={websiteConfig.address}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, address: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50"
/>
</div>
</div>
<button
type="button"
onClick={() => triggerToast('Konten informasi studio berhasil diperbarui!')}
className="px-4 py-2 bg-[#EC167F] text-white font-extrabold text-xs rounded-xl shadow-xs cursor-pointer"
>
Simpan Konten
</button>
</div>
)}
{/* 6. SEO & PENGATURAN SUB-VIEW */}
{subSection === 'seo' && (
<div className="bg-white p-6 rounded-3xl border border-slate-200/80 shadow-2xs space-y-5 max-w-2xl">
<h2 className="text-base font-extrabold text-slate-900">SEO (Search Engine Optimization)</h2>
<p className="text-xs text-slate-500">Agar calon klien lebih mudah menemukan studio MUA Anda di Google.</p>
<div className="space-y-3 text-xs">
<div>
<label className="block font-bold text-slate-700 mb-1">Meta Title (Judul Google)</label>
<input
type="text"
value={websiteConfig.metaTitle}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, metaTitle: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50"
/>
</div>
<div>
<label className="block font-bold text-slate-700 mb-1">Meta Description</label>
<textarea
rows={3}
value={websiteConfig.metaDescription}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, metaDescription: e.target.value })}
className="w-full p-2.5 border rounded-xl bg-slate-50"
/>
</div>
</div>
<button
type="button"
onClick={() => triggerToast('Pengaturan SEO berhasil diperbarui!')}
className="px-4 py-2 bg-[#EC167F] text-white font-extrabold text-xs rounded-xl shadow-xs cursor-pointer"
>
Simpan SEO
</button>
</div>
)}
{/* 7. DOMAIN SUB-VIEW */}
{subSection === 'domain' && (
<div className="bg-white p-6 rounded-3xl border border-slate-200/80 shadow-2xs space-y-5 max-w-2xl">
<h2 className="text-base font-extrabold text-slate-900">Pengaturan Subdomain MuaKita</h2>
<div className="p-4 bg-slate-50 rounded-2xl border space-y-2 text-xs">
<label className="block font-bold text-slate-700">Subdomain Resmi</label>
<div className="flex items-center gap-1 font-mono font-bold text-slate-900">
<span>https://</span>
<input
type="text"
value={websiteConfig.subdomain}
onChange={(e) => setWebsiteConfig({ ...websiteConfig, subdomain: e.target.value.toLowerCase().replace(/[^a-z0-9-]/g, '') })}
className="p-1.5 border rounded-lg bg-white"
/>
<span>.muakita.com</span>
</div>
</div>
<button
type="button"
onClick={() => triggerToast('Domain berhasil disimpan!')}
className="px-4 py-2 bg-[#EC167F] text-white font-extrabold text-xs rounded-xl shadow-xs cursor-pointer"
>
Simpan Domain
</button>
</div>
)}
{/* 8. ANALYTICS SUB-VIEW */}
{subSection === 'analytics' && (
<div className="bg-white p-6 rounded-3xl border border-slate-200/80 shadow-2xs space-y-5">
<h2 className="text-base font-extrabold text-slate-900">Analitik Pengunjung Website</h2>
<div className="grid grid-cols-1 sm:grid-cols-3 gap-4">
<div className="p-4 bg-pink-50/60 border border-pink-100 rounded-2xl">
<span className="text-xs font-bold text-slate-500">Total Pengunjung Hari Ini</span>
<span className="text-2xl font-black text-[#EC167F] block mt-1">184 Orang</span>
</div>
<div className="p-4 bg-emerald-50/60 border border-emerald-100 rounded-2xl">
<span className="text-xs font-bold text-slate-500">Total Klik WhatsApp</span>
<span className="text-2xl font-black text-emerald-600 block mt-1">28 Klik</span>
</div>
<div className="p-4 bg-purple-50/60 border border-purple-100 rounded-2xl">
<span className="text-xs font-bold text-slate-500">Total Form Submitted</span>
<span className="text-2xl font-black text-purple-600 block mt-1">12 Booking</span>
</div>
</div>
</div>
)}
{/* 9. FULL-SCREEN LIVE WEBSITE PREVIEW MODAL */}
{isPreviewModalOpen && (
<div className="fixed inset-0 bg-slate-950/85 backdrop-blur-md z-50 flex items-center justify-center p-2 sm:p-6 animate-in fade-in duration-200">
<div className="bg-white w-full max-w-6xl h-[92vh] rounded-3xl shadow-2xl flex flex-col overflow-hidden">
{/* Modal Device Switcher Header */}
<div className="p-4 bg-slate-900 text-white flex items-center justify-between">
<div className="flex items-center gap-3">
<span className="font-extrabold text-sm text-pink-400">{websiteConfig.studioName} Preview</span>
<span className="text-xs font-mono text-slate-400 hidden sm:inline">{fullDomainUrl}</span>
</div>
{/* Device Toggle */}
<div className="flex items-center gap-1 bg-slate-800 p-1 rounded-xl text-xs">
<button
type="button"
onClick={() => setPreviewDevice('desktop')}
className={`px-3 py-1 rounded-lg font-bold flex items-center gap-1 cursor-pointer ${
previewDevice === 'desktop' ? 'bg-[#EC167F] text-white' : 'text-slate-400 hover:text-white'
}`}
>
<Monitor className="w-3.5 h-3.5" />
<span>Desktop</span>
</button>
<button
type="button"
onClick={() => setPreviewDevice('mobile')}
className={`px-3 py-1 rounded-lg font-bold flex items-center gap-1 cursor-pointer ${
previewDevice === 'mobile' ? 'bg-[#EC167F] text-white' : 'text-slate-400 hover:text-white'
}`}
>
<Smartphone className="w-3.5 h-3.5" />
<span>Mobile</span>
</button>
</div>
<button
type="button"
onClick={() => setIsPreviewModalOpen(false)}
className="px-3.5 py-1.5 bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-extrabold rounded-xl cursor-pointer"
>
Tutup Preview
</button>
</div>
{/* Modal Body Frame rendering the exact website */}
<div className="flex-1 bg-slate-100 overflow-y-auto p-4 flex justify-center custom-scrollbar">
<div className={`transition-all duration-300 bg-white rounded-2xl shadow-lg border border-slate-200/80 overflow-hidden ${
previewDevice === 'mobile' ? 'w-[385px]' : 'w-full'
}`}>
{renderPublicWebsiteContent()}
</div>
</div>
</div>
</div>
)}
</div>
);
};