%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home2/rezakur1/muakita.rezakurnia.com/Mua-Kita-Web/src/components/
Upload File :
Create Path :
Current File : //home2/rezakur1/muakita.rezakurnia.com/Mua-Kita-Web/src/components/DemoModal.tsx

import React, { useState } from 'react';
import { X, Play, Sparkles, Shield, UserCheck, Calendar, ArrowRight, Laptop, Smartphone, CheckCircle } from 'lucide-react';
import { Role } from '../types';

interface DemoModalProps {
  isOpen: boolean;
  onClose: () => void;
  onLaunchDemo: (role: Role) => void;
}

export const DemoModal: React.FC<DemoModalProps> = ({ isOpen, onClose, onLaunchDemo }) => {
  const [selectedDemoRole, setSelectedDemoRole] = useState<Role>('owner');

  if (!isOpen) return null;

  const demoRoles = [
    {
      id: 'owner' as Role,
      title: 'Owner / Studio MUA',
      badge: 'Rekomendasi Utama',
      description: 'Kelola kalender reservasi, buat faktur, atur ongkos transport otomatis, kelola tim & laporan keuangan.',
      features: ['Dashboard Analytics & Revenue Graph', 'Form Booking Publik', 'Hitung Transport Maps API', 'Laporan Laba Rugi Real-Time'],
      icon: Sparkles,
      color: 'bg-pink-500 text-white',
    },
    {
      id: 'super_admin' as Role,
      title: 'Super Admin MuaKita',
      badge: 'SaaS Control',
      description: 'Pantau seluruh tenant studio MUA, statistik MRR, manajemen paket langganan & aktivasi lisensi.',
      features: ['Daftar Seluruh Tenant Studio', 'Monitoring Pendapatan Platform', 'Kontrol Paket & Fitur', 'Aktivasi Lisensi & Status '],
      icon: Shield,
      color: 'bg-slate-900 text-white',
    },
    {
      id: 'client' as Role,
      title: 'Portal Public Booking Klien',
      badge: 'Tampilan Klien',
      description: 'Pengalaman calon pengantin / klien MUA saat memilih jadwal, mengisi detail lokasi, dan bayar DP.',
      features: ['Katalog Layanan & Portfolio', 'Kalender Ketersediaan Jam', 'Hitung Transport otomatis', 'Konfirmasi WhatsApp & Invoice'],
      icon: UserCheck,
      color: 'bg-emerald-600 text-white',
    },
  ];

  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-4xl w-full shadow-2xl border border-slate-100 overflow-hidden my-8 flex flex-col max-h-[90vh]">
        
        {/* 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">
              <Play className="w-5 h-5 fill-white ml-0.5" />
            </div>
            <div>
              <h2 className="text-lg font-black tracking-tight">Interactive Live Demo MuaKita</h2>
              <p className="text-xs text-slate-300 mt-0.5">
                Coba pengalaman penuh aplikasi tanpa perlu mendaftar atau mengisi data
              </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>

        {/* Modal Content */}
        <div className="p-6 overflow-y-auto space-y-6 flex-1">
          <div>
            <span className="text-[11px] font-black uppercase tracking-wider text-[#EC167F] block">
              PILIH PERAN UNTUK MEMULAI DEMO
            </span>
            <h3 className="text-lg font-extrabold text-slate-900 mt-1">
              Jelajahi MuaKita dari Berbagai Sudut Pandang
            </h3>
          </div>

          {/* Role Cards Grid */}
          <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
            {demoRoles.map((role) => {
              const Icon = role.icon;
              const isSelected = selectedDemoRole === role.id;

              return (
                <div
                  key={role.id}
                  onClick={() => setSelectedDemoRole(role.id)}
                  className={`p-5 rounded-2xl border transition-all cursor-pointer flex flex-col justify-between space-y-4 ${
                    isSelected
                      ? 'bg-pink-50/40 border-[#EC167F] ring-2 ring-pink-500/20 shadow-md'
                      : 'bg-white border-slate-200 hover:border-pink-300'
                  }`}
                >
                  <div className="space-y-3">
                    <div className="flex items-center justify-between">
                      <div className={`w-9 h-9 rounded-xl ${role.color} flex items-center justify-center shadow-2xs`}>
                        <Icon className="w-4.5 h-4.5" />
                      </div>
                      <span className="text-[10px] font-extrabold px-2 py-0.5 bg-slate-100 text-slate-600 rounded-full">
                        {role.badge}
                      </span>
                    </div>

                    <div>
                      <h4 className="text-sm font-extrabold text-slate-900">{role.title}</h4>
                      <p className="text-xs text-slate-500 mt-1 leading-relaxed font-medium">
                        {role.description}
                      </p>
                    </div>

                    <div className="space-y-1.5 pt-2 border-t border-slate-100 text-[11px]">
                      {role.features.map((feat, fIdx) => (
                        <div key={fIdx} className="flex items-center gap-1.5 text-slate-700">
                          <CheckCircle className="w-3.5 h-3.5 text-[#EC167F] shrink-0" />
                          <span>{feat}</span>
                        </div>
                      ))}
                    </div>
                  </div>

                  <button
                    onClick={(e) => {
                      e.stopPropagation();
                      onLaunchDemo(role.id);
                      onClose();
                    }}
                    className={`w-full py-2.5 rounded-xl font-extrabold text-xs transition-all flex items-center justify-center gap-2 cursor-pointer ${
                      isSelected
                        ? 'bg-[#EC167F] hover:bg-[#D41270] text-white shadow-md shadow-pink-500/20'
                        : 'bg-slate-100 hover:bg-slate-200 text-slate-800'
                    }`}
                  >
                    <span>Masuk Demo Sebagai {role.title.split(' ')[0]}</span>
                    <ArrowRight className="w-3.5 h-3.5" />
                  </button>
                </div>
              );
            })}
          </div>

          {/* Interactive Device Preview Banner */}
          <div className="p-4 bg-slate-50 rounded-2xl border border-slate-200 flex flex-col sm:flex-row items-center justify-between gap-4 text-xs">
            <div className="flex items-center gap-3">
              <div className="flex -space-x-2">
                <div className="w-8 h-8 rounded-full bg-slate-900 text-white flex items-center justify-center font-bold text-[10px]">
                  <Laptop className="w-4 h-4" />
                </div>
                <div className="w-8 h-8 rounded-full bg-[#EC167F] text-white flex items-center justify-center font-bold text-[10px]">
                  <Smartphone className="w-4 h-4" />
                </div>
              </div>
              <div>
                <span className="font-extrabold text-slate-900 block">Responsif di Desktop &amp; HP</span>
                <span className="text-slate-500 font-medium">Akses langsung tanpa perlu download aplikasi tambahan</span>
              </div>
            </div>

            <button
              onClick={() => {
                onLaunchDemo(selectedDemoRole);
                onClose();
              }}
              className="px-5 py-2.5 bg-slate-900 hover:bg-slate-800 text-white rounded-xl font-extrabold transition-colors shrink-0 cursor-pointer"
            >
              Luncurkan Demo Sekarang
            </button>
          </div>

        </div>

      </div>
    </div>
  );
};

Zerion Mini Shell 1.0