%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/MarketplaceModal.tsx

import React, { useState } from 'react';
import { X, Search, Star, MapPin, Tag, ShoppingBag, Sparkles, Filter, ExternalLink, Heart, ShieldCheck } from 'lucide-react';

interface MarketplaceModalProps {
  isOpen: boolean;
  onClose: () => void;
  onOpenLogin: () => void;
}

export const MarketplaceModal: React.FC<MarketplaceModalProps> = ({ isOpen, onClose, onOpenLogin }) => {
  const [activeCategory, setActiveCategory] = useState<'mua' | 'products' | 'rentals'>('mua');
  const [searchQuery, setSearchQuery] = useState('');
  const [selectedCity, setSelectedCity] = useState('Semua Kota');

  if (!isOpen) return null;

  const muaListings = [
    {
      name: 'Glow Bridal Studio',
      owner: 'Giselle & Team',
      rating: 4.9,
      reviews: 128,
      city: 'Jakarta Selatan',
      specialty: 'Wedding & Engagement',
      priceFrom: 'Rp 2.500.000',
      image: 'https://images.unsplash.com/photo-1487412720507-e7ab37603c6f?auto=format&fit=crop&q=80&w=300',
      verified: true
    },
    {
      name: 'LAVISH Beauty MUA',
      owner: 'Anisa Putri, S.Sn',
      rating: 4.8,
      reviews: 94,
      city: 'Bandung',
      specialty: 'Sunda Siger & Modern Glam',
      priceFrom: 'Rp 1.800.000',
      image: 'https://images.unsplash.com/photo-1522337360788-8b13dee7a37e?auto=format&fit=crop&q=80&w=300',
      verified: true
    },
    {
      name: 'Bella Aesthetic Studio',
      owner: 'Bella Safira',
      rating: 4.9,
      reviews: 210,
      city: 'Surabaya',
      specialty: 'Graduation & Photoshoot',
      priceFrom: 'Rp 750.000',
      image: 'https://images.unsplash.com/photo-1512496015851-a90fb38ba796?auto=format&fit=crop&q=80&w=300',
      verified: true
    },
    {
      name: 'Flawless Beauty Artistry',
      owner: 'Dewi Lestari',
      rating: 4.7,
      reviews: 76,
      city: 'Medan',
      specialty: 'Traditional & Airbrush',
      priceFrom: 'Rp 1.500.000',
      image: 'https://images.unsplash.com/photo-1526047932273-341f2a7631f9?auto=format&fit=crop&q=80&w=300',
      verified: true
    },
  ];

  const productsList = [
    {
      title: 'Professional Ring Light 18 Inch + Tripod 2M',
      brand: 'Godox Beauty',
      discount: 'Diskon 20% Member MuaKita',
      originalPrice: 'Rp 850.000',
      promoPrice: 'Rp 680.000',
      rating: 4.9,
      image: 'https://images.unsplash.com/photo-1583001809873-a1284d5da086?auto=format&fit=crop&q=80&w=300'
    },
    {
      title: 'Airbrush Makeup Kit Pro - Portable Compressor',
      brand: 'Temptu Beauty',
      discount: 'Cashback Rp 150rb',
      originalPrice: 'Rp 3.200.000',
      promoPrice: 'Rp 2.950.000',
      rating: 4.9,
      image: 'https://images.unsplash.com/photo-1512496015851-a90fb38ba796?auto=format&fit=crop&q=80&w=300'
    },
    {
      title: 'MUA Train Case Koper Makeup Lampu & Cermin',
      brand: 'Glad2Glow Pro',
      discount: 'Gratis Ongkir',
      originalPrice: 'Rp 2.100.000',
      promoPrice: 'Rp 1.850.000',
      rating: 4.8,
      image: 'https://images.unsplash.com/photo-1522337360788-8b13dee7a37e?auto=format&fit=crop&q=80&w=300'
    }
  ];

  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">
        
        {/* 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">
              <ShoppingBag className="w-5 h-5 text-white" />
            </div>
            <div>
              <div className="flex items-center gap-2">
                <h2 className="text-lg font-black tracking-tight">MuaKita Beauty Marketplace</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">
                  Direktori &amp; Supply MUA
                </span>
              </div>
              <p className="text-xs text-slate-300 mt-0.5">
                Pusat direktori MUA terverifikasi, sewa alat lighting, dan suplai kosmetik profesional
              </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>

        {/* Filter & Submenu Bar */}
        <div className="bg-slate-50 border-b border-slate-200 px-6 py-3.5 flex flex-wrap items-center justify-between gap-3 shrink-0">
          
          {/* Category Tabs */}
          <div className="flex items-center gap-2 bg-slate-200/80 p-1 rounded-xl text-xs font-bold">
            <button
              onClick={() => setActiveCategory('mua')}
              className={`px-4 py-1.5 rounded-lg transition-all cursor-pointer ${
                activeCategory === 'mua' ? 'bg-white text-slate-900 shadow-2xs' : 'text-slate-600 hover:text-slate-900'
              }`}
            >
              Direktori MUA Studio
            </button>
            <button
              onClick={() => setActiveCategory('products')}
              className={`px-4 py-1.5 rounded-lg transition-all cursor-pointer ${
                activeCategory === 'products' ? 'bg-white text-slate-900 shadow-2xs' : 'text-slate-600 hover:text-slate-900'
              }`}
            >
              Peralatan &amp; Alat Makeup
            </button>
          </div>

          {/* Search Box */}
          <div className="flex items-center gap-2 flex-1 max-w-xs">
            <div className="relative w-full">
              <Search className="w-3.5 h-3.5 absolute left-3 top-1/2 -translate-y-1/2 text-slate-400" />
              <input
                type="text"
                placeholder="Cari MUA, lokasi, atau alat..."
                value={searchQuery}
                onChange={(e) => setSearchQuery(e.target.value)}
                className="w-full bg-white border border-slate-200 pl-8 pr-3 py-1.5 rounded-xl text-xs focus:outline-none focus:border-[#EC167F]"
              />
            </div>
          </div>

        </div>

        {/* Body Content */}
        <div className="p-6 overflow-y-auto space-y-6 flex-1">
          {activeCategory === 'mua' ? (
            <div className="space-y-4">
              <div className="flex items-center justify-between">
                <div>
                  <h3 className="text-sm font-extrabold text-slate-900">MUA Terverifikasi di Indonesia</h3>
                  <p className="text-xs text-slate-500">MUA yang menggunakan sistem manajemen reservasi MuaKita</p>
                </div>
                <button
                  onClick={onOpenLogin}
                  className="px-3.5 py-1.5 bg-pink-100 text-[#EC167F] hover:bg-pink-200 rounded-xl text-xs font-extrabold transition-colors cursor-pointer"
                >
                  + Daftarkan Studio Anda di Direktori
                </button>
              </div>

              <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
                {muaListings.map((item, idx) => (
                  <div key={idx} className="bg-white rounded-2xl border border-slate-200 overflow-hidden shadow-2xs hover:border-pink-300 transition-all flex flex-col justify-between">
                    <div>
                      <div className="relative h-36 bg-slate-100">
                        <img src={item.image} alt={item.name} className="w-full h-full object-cover" />
                        {item.verified && (
                          <span className="absolute top-2 right-2 bg-white/90 backdrop-blur-xs text-emerald-600 px-2 py-0.5 rounded-full text-[9px] font-black flex items-center gap-1 shadow-2xs">
                            <ShieldCheck className="w-3 h-3" />
                            <span>Verified MUA</span>
                          </span>
                        )}
                      </div>

                      <div className="p-3.5 space-y-2">
                        <div>
                          <div className="flex items-center justify-between">
                            <h4 className="text-xs font-extrabold text-slate-900 truncate">{item.name}</h4>
                            <div className="flex items-center gap-0.5 text-amber-500 font-bold text-[10px]">
                              <Star className="w-3 h-3 fill-amber-400" />
                              <span>{item.rating}</span>
                            </div>
                          </div>
                          <span className="text-[10px] text-slate-500 block font-medium mt-0.5">{item.owner}</span>
                        </div>

                        <div className="space-y-1 text-[10px] text-slate-600">
                          <div className="flex items-center gap-1">
                            <MapPin className="w-3 h-3 text-[#EC167F]" />
                            <span>{item.city}</span>
                          </div>
                          <div className="flex items-center gap-1">
                            <Tag className="w-3 h-3 text-slate-400" />
                            <span>{item.specialty}</span>
                          </div>
                        </div>
                      </div>
                    </div>

                    <div className="p-3.5 pt-0 border-t border-slate-100 mt-2 flex items-center justify-between">
                      <div>
                        <span className="text-[9px] text-slate-400 block font-medium">Mulai Dari</span>
                        <span className="text-xs font-black text-[#EC167F]">{item.priceFrom}</span>
                      </div>
                      <button
                        onClick={onOpenLogin}
                        className="px-3 py-1.5 bg-slate-900 hover:bg-slate-800 text-white text-[10px] font-bold rounded-lg transition-colors cursor-pointer"
                      >
                        Lihat Form Booking
                      </button>
                    </div>

                  </div>
                ))}
              </div>
            </div>
          ) : (
            <div className="space-y-4">
              <div>
                <h3 className="text-sm font-extrabold text-slate-900">Perlengkap &amp; Supply Khusus MUA</h3>
                <p className="text-xs text-slate-500">Harga spesial promo eksklusif untuk seluruh MUA terdaftar di MuaKita</p>
              </div>

              <div className="grid grid-cols-1 sm:grid-cols-3 gap-4">
                {productsList.map((prod, idx) => (
                  <div key={idx} className="bg-white rounded-2xl border border-slate-200 p-4 space-y-3 shadow-2xs hover:border-pink-300 transition-all flex flex-col justify-between">
                    <div className="space-y-3">
                      <div className="h-40 rounded-xl overflow-hidden bg-slate-100 relative">
                        <img src={prod.image} alt={prod.title} className="w-full h-full object-cover" />
                        <span className="absolute top-2 left-2 bg-[#EC167F] text-white px-2 py-0.5 rounded-full text-[9px] font-extrabold">
                          {prod.discount}
                        </span>
                      </div>

                      <div>
                        <span className="text-[10px] text-slate-400 font-bold block">{prod.brand}</span>
                        <h4 className="text-xs font-extrabold text-slate-900 leading-tight mt-0.5">{prod.title}</h4>
                      </div>

                      <div className="flex items-baseline gap-2 pt-1">
                        <span className="text-sm font-black text-[#EC167F]">{prod.promoPrice}</span>
                        <span className="text-xs text-slate-400 line-through font-medium">{prod.originalPrice}</span>
                      </div>
                    </div>

                    <button
                      onClick={onOpenLogin}
                      className="w-full py-2 bg-slate-100 hover:bg-pink-100 text-[#EC167F] rounded-xl font-bold text-xs transition-colors cursor-pointer mt-3"
                    >
                      Beli Dengan Diskon Member
                    </button>
                  </div>
                ))}
              </div>
            </div>
          )}
        </div>

        {/* Footer */}
        <div className="bg-slate-50 border-t border-slate-200 px-6 py-4 flex items-center justify-between text-xs text-slate-500 font-medium shrink-0">
          <span>Ingin menjual produk / sewa studio di Marketplace MuaKita?</span>
          <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>
  );
};

Zerion Mini Shell 1.0