%PDF- %PDF-
| Direktori : /home2/rezakur1/muakita.rezakurnia.com/Mua-Kita-Web/src/components/ |
| Current File : /home2/rezakur1/muakita.rezakurnia.com/Mua-Kita-Web/src/components/PaketModal.tsx |
import React, { useState } from 'react';
import { X, Check, Sparkles, HelpCircle, ArrowRight, ShieldCheck, Zap, Users, Building } from 'lucide-react';
import { Role } from '../types';
interface PaketModalProps {
isOpen: boolean;
onClose: () => void;
onSelectPlan: (planName: string, role?: Role) => void;
}
export const PaketModal: React.FC<PaketModalProps> = ({ isOpen, onClose, onSelectPlan }) => {
const [billingCycle, setBillingCycle] = useState<'monthly' | 'yearly'>('monthly');
const [activeTab, setActiveTab] = useState<'matrix' | 'calculator'>('matrix');
const [teamSize, setTeamSize] = useState<number>(3);
const [includeWhatsapp, setIncludeWhatsapp] = useState<boolean>(true);
const [includeCustomDomain, setIncludeCustomDomain] = useState<boolean>(false);
if (!isOpen) return null;
// Pricing calculation
const basePricePerUser = billingCycle === 'monthly' ? 99000 : 79000;
const whatsappAddon = includeWhatsapp ? (billingCycle === 'monthly' ? 50000 : 40000) : 0;
const domainAddon = includeCustomDomain ? (billingCycle === 'monthly' ? 75000 : 60000) : 0;
const estimatedTotal = (teamSize * basePricePerUser) + whatsappAddon + domainAddon;
const featuresList = [
{ name: 'Reservasi & Kalender Digital', starter: true, pro: true, biz: true, ent: true },
{ name: 'Database Pelanggan & Catatan Preferences', starter: true, pro: true, biz: true, ent: true },
{ name: 'Katalog Layanan & Price List', starter: true, pro: true, biz: true, ent: true },
{ name: 'Hitung Transport Otomatis (Google Maps API)', starter: false, pro: true, biz: true, ent: true },
{ name: 'Manajemen Tim & Komisi Staff', starter: false, pro: true, biz: true, ent: true },
{ name: 'Modul Wedding & Event Rundown', starter: false, pro: true, biz: true, ent: true },
{ name: 'Keuangan, Arus Kas & Laporan Laba Rugi', starter: 'Dasar', pro: 'Lengkap', biz: 'Advanced', ent: 'Custom' },
{ name: 'Manajemen Inventaris & Alert Stok', starter: false, pro: true, biz: true, ent: true },
{ name: 'Promosi & Diskon Voucher', starter: false, pro: true, biz: true, ent: true },
{ name: 'Website Landing Page & Form Booking Publik', starter: false, pro: true, biz: true, ent: true },
{ name: 'Notifikasi Otomatis WhatsApp Gateway', starter: false, pro: 'Optional', biz: true, ent: true },
{ name: 'Multi-Cabang & Multi-Outlet', starter: false, pro: false, biz: true, ent: true },
{ name: 'Dedicated Account Manager & SLA 99.9%', starter: false, pro: false, biz: false, ent: true },
];
return (
<div className="fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 overflow-y-auto bg-slate-900/60 backdrop-blur-sm animate-in fade-in duration-200">
<div className="bg-white rounded-3xl max-w-5xl w-full shadow-2xl border border-slate-100 overflow-hidden my-8 max-h-[90vh] flex flex-col">
{/* Modal Header */}
<div className="bg-gradient-to-r from-slate-900 via-slate-800 to-slate-900 px-6 py-5 text-white flex items-center justify-between shrink-0">
<div className="flex items-center gap-3">
<div className="w-10 h-10 rounded-2xl bg-[#EC167F] flex items-center justify-center text-white font-black text-xl shadow-md shadow-pink-500/30">
M
</div>
<div>
<div className="flex items-center gap-2">
<h2 className="text-lg font-black tracking-tight">Pilih Paket MuaKita</h2>
<span className="px-2.5 py-0.5 rounded-full bg-pink-500/20 text-pink-300 border border-pink-500/30 text-[10px] font-bold">
Bebas Resiko 14 Hari
</span>
</div>
<p className="text-xs text-slate-300 mt-0.5">
Investasi terbaik untuk memodernisasi dan melipatgandakan omset bisnis MUA Anda
</p>
</div>
</div>
<button
onClick={onClose}
className="p-2 rounded-full hover:bg-white/10 text-slate-400 hover:text-white transition-colors cursor-pointer"
>
<X className="w-5 h-5" />
</button>
</div>
{/* Navigation Tabs & Billing Cycle Controls */}
<div className="bg-slate-50 border-b border-slate-200 px-6 py-3 flex flex-wrap items-center justify-between gap-4 shrink-0">
{/* Tabs */}
<div className="flex items-center gap-2 bg-slate-200/70 p-1 rounded-xl text-xs font-bold">
<button
onClick={() => setActiveTab('matrix')}
className={`px-4 py-1.5 rounded-lg transition-all cursor-pointer ${
activeTab === 'matrix' ? 'bg-white text-slate-900 shadow-2xs' : 'text-slate-600 hover:text-slate-900'
}`}
>
Matriks Perbandingan Fitur
</button>
<button
onClick={() => setActiveTab('calculator')}
className={`px-4 py-1.5 rounded-lg transition-all cursor-pointer flex items-center gap-1.5 ${
activeTab === 'calculator' ? 'bg-white text-slate-900 shadow-2xs' : 'text-slate-600 hover:text-slate-900'
}`}
>
<Zap className="w-3.5 h-3.5 text-[#EC167F]" />
<span>Kalkulator Estimasi Kebutuhan</span>
</button>
</div>
{/* Billing Switcher */}
<div className="flex items-center gap-3 text-xs font-extrabold">
<span className={billingCycle === 'monthly' ? 'text-slate-900' : 'text-slate-400'}>Bulanan</span>
<button
onClick={() => setBillingCycle(billingCycle === 'monthly' ? 'yearly' : 'monthly')}
className={`w-12 h-6 rounded-full p-1 transition-colors cursor-pointer ${
billingCycle === 'yearly' ? 'bg-[#EC167F]' : 'bg-slate-300'
}`}
>
<div
className={`w-4 h-4 rounded-full bg-white transition-transform ${
billingCycle === 'yearly' ? 'translate-x-6' : 'translate-x-0'
}`}
/>
</button>
<div className="flex items-center gap-1.5">
<span className={billingCycle === 'yearly' ? 'text-slate-900' : 'text-slate-400'}>Tahunan</span>
<span className="px-2 py-0.5 rounded-full bg-emerald-100 text-emerald-700 text-[10px] font-black">
Hemat 20%
</span>
</div>
</div>
</div>
{/* Modal Scrollable Body */}
<div className="p-6 overflow-y-auto space-y-6 flex-1">
{activeTab === 'matrix' ? (
<div className="space-y-6">
{/* 4 Cards Summary Top Row */}
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
{/* Starter */}
<div className="p-4 rounded-2xl bg-white border border-slate-200 space-y-3 flex flex-col justify-between">
<div>
<span className="text-xs font-bold text-slate-500 uppercase tracking-wider block">Starter</span>
<div className="mt-1">
<span className="text-2xl font-black text-slate-900">
Rp {billingCycle === 'yearly' ? '119.000' : '149.000'}
</span>
<span className="text-[11px] text-slate-400 block font-medium">/bulan per studio</span>
</div>
<p className="text-[11px] text-slate-500 mt-2 font-medium">
Ideal untuk MUA Solo / Freelancer yang baru memulai operasional rapi.
</p>
</div>
<button
onClick={() => onSelectPlan('Starter', 'owner')}
className="w-full py-2 bg-slate-100 hover:bg-slate-200 text-slate-800 rounded-xl text-xs font-bold transition-colors cursor-pointer"
>
Pilih Starter
</button>
</div>
{/* Professional (Highlighted) */}
<div className="p-4 rounded-2xl bg-pink-50/50 border-2 border-[#EC167F] space-y-3 flex flex-col justify-between relative">
<span className="absolute -top-3 left-1/2 -translate-x-1/2 px-2.5 py-0.5 bg-[#EC167F] text-white text-[9px] font-black rounded-full uppercase tracking-wider">
Paling Populer
</span>
<div>
<span className="text-xs font-extrabold text-[#EC167F] uppercase tracking-wider block">Professional</span>
<div className="mt-1">
<span className="text-2xl font-black text-slate-900">
Rp {billingCycle === 'yearly' ? '239.000' : '299.000'}
</span>
<span className="text-[11px] text-slate-400 block font-medium">/bulan per studio</span>
</div>
<p className="text-[11px] text-slate-500 mt-2 font-medium">
Untuk MUA profesional dengan asisten/tim yang ingin merambah otomatisasi.
</p>
</div>
<button
onClick={() => onSelectPlan('Professional', 'owner')}
className="w-full py-2 bg-[#EC167F] hover:bg-[#D41270] text-white rounded-xl text-xs font-extrabold shadow-md shadow-pink-500/20 transition-all cursor-pointer"
>
Pilih Professional
</button>
</div>
{/* Business */}
<div className="p-4 rounded-2xl bg-white border border-slate-200 space-y-3 flex flex-col justify-between">
<div>
<span className="text-xs font-bold text-slate-500 uppercase tracking-wider block">Business</span>
<div className="mt-1">
<span className="text-2xl font-black text-slate-900">
Rp {billingCycle === 'yearly' ? '399.000' : '499.000'}
</span>
<span className="text-[11px] text-slate-400 block font-medium">/bulan per studio</span>
</div>
<p className="text-[11px] text-slate-500 mt-2 font-medium">
Untuk Beauty Salon & Studio MUA multi-tim dengan kebutuhan analisis lengkap.
</p>
</div>
<button
onClick={() => onSelectPlan('Business', 'owner')}
className="w-full py-2 bg-slate-100 hover:bg-slate-200 text-slate-800 rounded-xl text-xs font-bold transition-colors cursor-pointer"
>
Pilih Business
</button>
</div>
{/* Enterprise */}
<div className="p-4 rounded-2xl bg-white border border-slate-200 space-y-3 flex flex-col justify-between">
<div>
<span className="text-xs font-bold text-slate-500 uppercase tracking-wider block">Enterprise</span>
<div className="mt-1">
<span className="text-2xl font-black text-slate-900">Custom</span>
<span className="text-[11px] text-slate-400 block font-medium">Sesuai kebutuhan cabang</span>
</div>
<p className="text-[11px] text-slate-500 mt-2 font-medium">
Untuk Franchise & Jaringan Klinik Beauty dengan custom integrasi API.
</p>
</div>
<button
onClick={() => onSelectPlan('Enterprise', 'super_admin')}
className="w-full py-2 bg-slate-900 hover:bg-slate-800 text-white rounded-xl text-xs font-bold transition-colors cursor-pointer"
>
Hubungi tim Enterprise
</button>
</div>
</div>
{/* Detailed Matrix Table */}
<div className="border border-slate-200 rounded-2xl overflow-hidden text-xs">
<table className="w-full text-left border-collapse">
<thead>
<tr className="bg-slate-100/80 text-slate-800 border-b border-slate-200 font-extrabold">
<th className="p-3 sm:p-4 w-1/3">Fitur Lengkap</th>
<th className="p-3 text-center">Starter</th>
<th className="p-3 text-center bg-pink-50/60 text-[#EC167F]">Professional</th>
<th className="p-3 text-center">Business</th>
<th className="p-3 text-center">Enterprise</th>
</tr>
</thead>
<tbody className="divide-y divide-slate-100 text-slate-700 font-medium">
{featuresList.map((item, idx) => (
<tr key={idx} className="hover:bg-slate-50/80 transition-colors">
<td className="p-3 sm:p-4 font-semibold text-slate-900">{item.name}</td>
<td className="p-3 text-center">
{typeof item.starter === 'boolean' ? (
item.starter ? <Check className="w-4 h-4 text-emerald-600 mx-auto" /> : <span className="text-slate-300">—</span>
) : (
<span className="text-[11px] font-bold text-slate-600">{item.starter}</span>
)}
</td>
<td className="p-3 text-center bg-pink-50/30 font-bold">
{typeof item.pro === 'boolean' ? (
item.pro ? <Check className="w-4 h-4 text-[#EC167F] mx-auto stroke-[2.5]" /> : <span className="text-slate-300">—</span>
) : (
<span className="text-[11px] text-[#EC167F] font-extrabold">{item.pro}</span>
)}
</td>
<td className="p-3 text-center">
{typeof item.biz === 'boolean' ? (
item.biz ? <Check className="w-4 h-4 text-emerald-600 mx-auto" /> : <span className="text-slate-300">—</span>
) : (
<span className="text-[11px] font-bold text-slate-600">{item.biz}</span>
)}
</td>
<td className="p-3 text-center">
{typeof item.ent === 'boolean' ? (
item.ent ? <Check className="w-4 h-4 text-emerald-600 mx-auto" /> : <span className="text-slate-300">—</span>
) : (
<span className="text-[11px] font-bold text-slate-600">{item.ent}</span>
)}
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
) : (
/* Kalkulator Estimasi Kebutuhan */
<div className="grid grid-cols-1 md:grid-cols-12 gap-8 items-start">
<div className="md:col-span-7 space-y-6">
<div>
<h3 className="text-base font-extrabold text-slate-900">Hitung Estimasi Biaya Langganan</h3>
<p className="text-xs text-slate-500">Sesuaikan jumlah anggota tim MUA & add-on sesuai skala operasional bisnis Anda.</p>
</div>
{/* Team Size Slider */}
<div className="bg-slate-50 p-4 rounded-2xl border border-slate-200 space-y-3">
<div className="flex justify-between items-center text-xs">
<label className="font-extrabold text-slate-800 flex items-center gap-2">
<Users className="w-4 h-4 text-[#EC167F]" />
<span>Jumlah Tim / Asisten MUA</span>
</label>
<span className="px-3 py-1 bg-[#EC167F] text-white rounded-lg font-black text-xs">
{teamSize} Anggota
</span>
</div>
<input
type="range"
min={1}
max={20}
value={teamSize}
onChange={(e) => setTeamSize(parseInt(e.target.value))}
className="w-full accent-[#EC167F] cursor-pointer"
/>
<div className="flex justify-between text-[10px] text-slate-400 font-bold">
<span>1 (Solo MUA)</span>
<span>10 Staff</span>
<span>20+ Staff</span>
</div>
</div>
{/* Optional Add-ons */}
<div className="space-y-3">
<h4 className="text-xs font-extrabold text-slate-800">Add-On Tambahan</h4>
<label className="flex items-center justify-between p-3.5 bg-white border border-slate-200 rounded-2xl cursor-pointer hover:border-pink-300 transition-colors">
<div className="flex items-center gap-3">
<input
type="checkbox"
checked={includeWhatsapp}
onChange={(e) => setIncludeWhatsapp(e.target.checked)}
className="w-4 h-4 accent-[#EC167F] rounded cursor-pointer"
/>
<div>
<span className="text-xs font-bold text-slate-900 block">WhatsApp Auto Reminder Gateway</span>
<span className="text-[10px] text-slate-500">Kirim konfirmasi H-1 & invoice otomatis ke WhatsApp klien</span>
</div>
</div>
<span className="text-xs font-black text-[#EC167F]">
+Rp {billingCycle === 'yearly' ? '40.000' : '50.000'} <span className="text-[9px] text-slate-400 font-normal">/bln</span>
</span>
</label>
<label className="flex items-center justify-between p-3.5 bg-white border border-slate-200 rounded-2xl cursor-pointer hover:border-pink-300 transition-colors">
<div className="flex items-center gap-3">
<input
type="checkbox"
checked={includeCustomDomain}
onChange={(e) => setIncludeCustomDomain(e.target.checked)}
className="w-4 h-4 accent-[#EC167F] rounded cursor-pointer"
/>
<div>
<span className="text-xs font-bold text-slate-900 block">Custom Domain Website (.com / .id)</span>
<span className="text-[10px] text-slate-500">Form booking menggunakan nama domain kustom studio Anda</span>
</div>
</div>
<span className="text-xs font-black text-[#EC167F]">
+Rp {billingCycle === 'yearly' ? '60.000' : '75.000'} <span className="text-[9px] text-slate-400 font-normal">/bln</span>
</span>
</label>
</div>
</div>
{/* Price Calculation Card */}
<div className="md:col-span-5 bg-gradient-to-br from-slate-900 to-slate-800 p-6 rounded-3xl text-white space-y-5 shadow-xl">
<div>
<span className="text-[10px] font-black uppercase tracking-widest text-pink-400 block">ESTIMASI TOTAL</span>
<div className="mt-2 flex items-baseline gap-1">
<span className="text-xs text-slate-400 font-bold">Rp</span>
<span className="text-3xl font-black text-white">{estimatedTotal.toLocaleString('id-ID')}</span>
<span className="text-xs text-slate-400">/ bulan</span>
</div>
<p className="text-[11px] text-slate-300 mt-1">
{billingCycle === 'yearly' ? 'Ditagihkan tahunan (Hemat 20%)' : 'Ditagihkan bulanan'}
</p>
</div>
<div className="space-y-2 border-t border-slate-700/60 pt-4 text-xs">
<div className="flex justify-between text-slate-300">
<span>{teamSize} Pengguna Studio</span>
<span>Rp {(teamSize * basePricePerUser).toLocaleString('id-ID')}</span>
</div>
{includeWhatsapp && (
<div className="flex justify-between text-slate-300">
<span>WA Reminder Gateway</span>
<span>Rp {whatsappAddon.toLocaleString('id-ID')}</span>
</div>
)}
{includeCustomDomain && (
<div className="flex justify-between text-slate-300">
<span>Custom Domain Domain</span>
<span>Rp {domainAddon.toLocaleString('id-ID')}</span>
</div>
)}
</div>
<div className="pt-2">
<button
onClick={() => onSelectPlan('Custom Estimate', 'owner')}
className="w-full py-3 bg-[#EC167F] hover:bg-[#D41270] text-white font-extrabold text-xs rounded-xl shadow-lg shadow-pink-500/30 transition-all flex items-center justify-center gap-2 cursor-pointer"
>
<span>Mulai Trial Gratis 14 Hari</span>
<ArrowRight className="w-4 h-4" />
</button>
<span className="text-[10px] text-slate-400 text-center block mt-2 font-medium">
Tanpa kartu kredit • Siap digunakan dalam 2 menit
</span>
</div>
</div>
</div>
)}
</div>
{/* Modal Footer */}
<div className="bg-slate-50 border-t border-slate-200 px-6 py-4 flex flex-col sm:flex-row items-center justify-between gap-3 shrink-0 text-xs text-slate-500 font-medium">
<div className="flex items-center gap-2">
<ShieldCheck className="w-4 h-4 text-emerald-600" />
<span>Garansi uang kembali 30 hari tanpa pertanyaan</span>
</div>
<button
onClick={onClose}
className="px-4 py-2 bg-slate-200 hover:bg-slate-300 text-slate-700 rounded-xl font-bold cursor-pointer"
>
Tutup
</button>
</div>
</div>
</div>
);
};