%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/TenantDetailView.tsx |
import React, { useState } from 'react';
import {
ArrowLeft, ExternalLink, Mail, Phone, Calendar, User, MapPin,
Users, Package, Edit, ShieldAlert, ChevronDown, CheckCircle2, Copy,
CreditCard, DollarSign, Layers, HeartHandshake, UserCheck, Check,
Globe, Shield, Key, Trash2, ArrowRight, LogIn, Lock, AlertCircle,
Building, RefreshCw, Smartphone, HardDrive, Send, Zap, FileText,
Clock, CheckCircle, Award
} from 'lucide-react';
interface TenantDetailViewProps {
tenantId?: string;
onBack: () => void;
triggerToast: (msg: string) => void;
}
export const TenantDetailView: React.FC<TenantDetailViewProps> = ({
tenantId = 'TEN-000312',
onBack,
triggerToast,
}) => {
const [activeTab, setActiveTab] = useState<
'Ringkasan' | 'Pengguna' | 'Paket & Billing' | 'Domain & Akses' | 'Penggunaan Fitur' | 'Aktivitas' | 'Log & Riwayat'
>('Ringkasan');
const [copied, setCopied] = useState(false);
const handleCopy = (text: string, label: string) => {
navigator.clipboard.writeText(text);
triggerToast(`${label} berhasil disalin!`);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
};
return (
<div className="space-y-5 animate-in fade-in duration-200 text-slate-800 pb-12">
{/* Navigation Back Button */}
<div className="flex items-center justify-between">
<button
onClick={onBack}
className="inline-flex items-center gap-2 px-3 py-1.5 rounded-xl bg-white hover:bg-slate-50 border border-slate-200/80 text-slate-600 font-bold text-xs transition-colors cursor-pointer shadow-2xs"
>
<ArrowLeft className="w-4 h-4 text-slate-500" />
<span>Kembali ke Daftar Tenant</span>
</button>
<span className="text-xs font-semibold text-slate-400">
Super Admin / Manajemen Tenant / <strong className="text-slate-700 font-bold">Detail Tenant</strong>
</span>
</div>
{/* ========================================================= */}
{/* 1. TOP HEADER BANNER CARD */}
{/* ========================================================= */}
<div className="bg-white rounded-2xl border border-slate-200/80 shadow-2xs p-5 md:p-6 space-y-6">
<div className="flex flex-col lg:flex-row items-start lg:items-center justify-between gap-6">
{/* Left Block: Logo, Title, Badges, Links */}
<div className="flex items-start sm:items-center gap-4 flex-1">
{/* Logo Badge */}
<div className="w-16 h-16 rounded-full bg-black text-white flex flex-col items-center justify-center p-2 text-center shrink-0 shadow-md">
<span className="font-serif italic font-bold text-sm tracking-tight leading-none text-pink-200">Glow</span>
<span className="text-[7px] tracking-widest font-sans uppercase text-slate-300 mt-0.5">BRIDAL STUDIO</span>
</div>
<div className="space-y-1.5 min-w-0">
<div className="flex flex-wrap items-center gap-2">
<h1 className="text-2xl font-black text-slate-900 tracking-tight">Glow Bridal Studio</h1>
{/* Status Badges */}
<span className="px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-emerald-100/90 text-emerald-700 flex items-center gap-1">
<span className="w-1.5 h-1.5 rounded-full bg-emerald-500"></span>
Aktif
</span>
<span className="px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-purple-100 text-purple-700">
Enterprise
</span>
</div>
{/* Subdomain, Email, Phone */}
<div className="flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-slate-500 font-medium">
<a
href="https://glowbridal.muakita.com"
target="_blank"
rel="noreferrer"
className="flex items-center gap-1 text-slate-600 hover:text-[#EC167F] font-semibold"
>
<Globe className="w-3.5 h-3.5 text-slate-400" />
<span>glowbridal.muakita.com</span>
<ExternalLink className="w-3 h-3 text-slate-400" />
</a>
<div className="flex items-center gap-1 text-slate-600">
<Mail className="w-3.5 h-3.5 text-slate-400" />
<span>glowbridal@gmail.com</span>
</div>
<div className="flex items-center gap-1 text-slate-600">
<Phone className="w-3.5 h-3.5 text-slate-400" />
<span>0812-1234-5678</span>
</div>
</div>
</div>
</div>
{/* Right Action Buttons */}
<div className="flex items-center gap-2 self-end lg:self-start shrink-0">
<button
onClick={() => triggerToast('Membuka modal edit tenant')}
className="px-3.5 py-2 bg-white hover:bg-slate-50 text-slate-700 border border-slate-200 rounded-xl text-xs font-bold flex items-center gap-1.5 transition-colors cursor-pointer shadow-2xs"
>
<Edit className="w-3.5 h-3.5 text-slate-500" />
<span>Edit Tenant</span>
</button>
<button
onClick={() => triggerToast('Konfirmasi suspend tenant')}
className="px-3.5 py-2 bg-amber-50 hover:bg-amber-100 text-amber-700 border border-amber-200 rounded-xl text-xs font-bold flex items-center gap-1.5 transition-colors cursor-pointer"
>
<AlertCircle className="w-3.5 h-3.5 text-amber-600" />
<span>Suspend</span>
</button>
<div className="relative group">
<button className="px-3 py-2 bg-white hover:bg-slate-50 text-slate-700 border border-slate-200 rounded-xl text-xs font-bold flex items-center gap-1 transition-colors cursor-pointer shadow-2xs">
<span>Lainnya</span>
<ChevronDown className="w-3.5 h-3.5 text-slate-400" />
</button>
</div>
</div>
</div>
{/* 2 Grid Sections: Information Details & Payment Box */}
<div className="grid grid-cols-1 lg:grid-cols-12 gap-6 pt-5 border-t border-slate-100">
{/* Left Grid: 6 Attributes (Spans 8 columns) */}
<div className="lg:col-span-8 grid grid-cols-1 sm:grid-cols-3 gap-y-4 gap-x-6 text-xs">
{/* Row 1, Col 1: Tanggal Bergabung */}
<div className="flex items-start gap-2.5">
<div className="w-8 h-8 rounded-lg bg-slate-100 text-slate-500 flex items-center justify-center shrink-0">
<Calendar className="w-4 h-4" />
</div>
<div>
<span className="text-slate-400 text-[11px] font-medium block">Tanggal Bergabung</span>
<strong className="text-slate-900 font-bold block text-xs">10 Mei 2025</strong>
<span className="text-[10px] text-slate-400 block">1 bulan lalu</span>
</div>
</div>
{/* Row 1, Col 2: Pemilik / Owner */}
<div className="flex items-start gap-2.5">
<div className="w-8 h-8 rounded-lg bg-slate-100 text-slate-500 flex items-center justify-center shrink-0">
<User className="w-4 h-4" />
</div>
<div>
<span className="text-slate-400 text-[11px] font-medium block">Pemilik / Owner</span>
<strong className="text-slate-900 font-bold block text-xs">Dewi Lestari</strong>
<span className="text-[10px] text-slate-400 block truncate max-w-[130px]">dewilestari@gmail.com</span>
</div>
</div>
{/* Row 1, Col 3: Lokasi */}
<div className="flex items-start gap-2.5">
<div className="w-8 h-8 rounded-lg bg-slate-100 text-slate-500 flex items-center justify-center shrink-0">
<MapPin className="w-4 h-4" />
</div>
<div>
<span className="text-slate-400 text-[11px] font-medium block">Lokasi</span>
<strong className="text-slate-900 font-bold block text-xs">Jakarta, Indonesia</strong>
<span className="text-[10px] text-slate-400 block">GMT +07:00</span>
</div>
</div>
{/* Row 2, Col 1: ID Tenant */}
<div className="flex items-start gap-2.5">
<div className="w-8 h-8 rounded-lg bg-slate-100 text-slate-500 flex items-center justify-center shrink-0">
<FileText className="w-4 h-4" />
</div>
<div>
<span className="text-slate-400 text-[11px] font-medium block">ID Tenant</span>
<div className="flex items-center gap-1">
<strong className="text-slate-900 font-bold text-xs">{tenantId}</strong>
<button
onClick={() => handleCopy(tenantId, 'ID Tenant')}
className="p-1 text-slate-400 hover:text-slate-600 transition-colors cursor-pointer"
title="Salin ID"
>
<Copy className="w-3 h-3" />
</button>
</div>
</div>
</div>
{/* Row 2, Col 2: Jumlah Pengguna */}
<div className="flex items-start gap-2.5">
<div className="w-8 h-8 rounded-lg bg-slate-100 text-slate-500 flex items-center justify-center shrink-0">
<Users className="w-4 h-4" />
</div>
<div>
<span className="text-slate-400 text-[11px] font-medium block">Jumlah Pengguna</span>
<strong className="text-slate-900 font-bold block text-xs">8 User</strong>
<button
onClick={() => setActiveTab('Pengguna')}
className="text-[10px] text-pink-600 font-semibold hover:underline block cursor-pointer"
>
Lihat detail
</button>
</div>
</div>
{/* Row 2, Col 3: Paket Berlangganan */}
<div className="flex items-start gap-2.5">
<div className="w-8 h-8 rounded-lg bg-slate-100 text-slate-500 flex items-center justify-center shrink-0">
<Award className="w-4 h-4" />
</div>
<div>
<span className="text-slate-400 text-[11px] font-medium block">Paket Berlangganan</span>
<strong className="text-slate-900 font-bold block text-xs">Enterprise</strong>
<span className="text-[10px] text-slate-400 block">Rp599.000 / bulan</span>
</div>
</div>
</div>
{/* Right Box: Status Pembayaran (Spans 4 columns) */}
<div className="lg:col-span-4 bg-slate-50/80 rounded-xl p-3.5 border border-slate-200/60 text-xs space-y-2">
<div className="flex items-center justify-between border-b border-slate-200/60 pb-2">
<span className="font-bold text-slate-700 text-[11px]">Status Pembayaran</span>
<span className="font-bold text-emerald-600 text-xs flex items-center gap-1">
<span className="w-1.5 h-1.5 rounded-full bg-emerald-500"></span>
Aktif
</span>
</div>
<div className="flex items-center justify-between text-[11px]">
<span className="text-slate-500">Siklus Berlangganan</span>
<span className="font-bold text-slate-900">Bulanan</span>
</div>
<div className="flex items-center justify-between text-[11px]">
<span className="text-slate-500">Tanggal Berakhir</span>
<div className="text-right">
<span className="font-bold text-slate-900 block">10 Mei 2026</span>
<span className="text-[10px] text-slate-400 block">11 bulan lagi</span>
</div>
</div>
<div className="flex items-center justify-between text-[11px] pt-1 border-t border-slate-200/60">
<span className="text-slate-500">Metode Pembayaran</span>
<div className="flex items-center gap-1.5">
<span className="font-mono text-slate-700 text-[10px]">•••• 4242 (Visa)</span>
<span className="px-1.5 py-0.5 bg-blue-900 text-white font-extrabold text-[8px] rounded tracking-widest italic">
VISA
</span>
</div>
</div>
</div>
</div>
</div>
{/* ========================================================= */}
{/* 2. TAB NAVIGATION BAR */}
{/* ========================================================= */}
<div className="bg-white rounded-2xl border border-slate-200/80 shadow-2xs px-2 pt-1">
<div className="flex items-center gap-1 overflow-x-auto no-scrollbar scroll-smooth text-xs">
{[
{ id: 'Ringkasan', label: 'Ringkasan' },
{ id: 'Pengguna', label: 'Pengguna (8)' },
{ id: 'Paket & Billing', label: 'Paket & Billing' },
{ id: 'Domain & Akses', label: 'Domain & Akses' },
{ id: 'Penggunaan Fitur', label: 'Penggunaan Fitur' },
{ id: 'Aktivitas', label: 'Aktivitas' },
{ id: 'Log & Riwayat', label: 'Log & Riwayat' },
].map((tab) => {
const isActive = activeTab === tab.id;
return (
<button
key={tab.id}
onClick={() => setActiveTab(tab.id as any)}
className={`py-3 px-4 font-bold border-b-2 transition-all whitespace-nowrap cursor-pointer flex items-center gap-1.5 ${
isActive
? 'border-[#EC167F] text-[#EC167F]'
: 'border-transparent text-slate-500 hover:text-slate-800 hover:border-slate-300'
}`}
>
{tab.id === 'Ringkasan' && <Layers className="w-3.5 h-3.5" />}
{tab.id === 'Pengguna' && <Users className="w-3.5 h-3.5" />}
{tab.id === 'Paket & Billing' && <CreditCard className="w-3.5 h-3.5" />}
{tab.id === 'Domain & Akses' && <Globe className="w-3.5 h-3.5" />}
{tab.id === 'Penggunaan Fitur' && <Zap className="w-3.5 h-3.5" />}
{tab.id === 'Aktivitas' && <Clock className="w-3.5 h-3.5" />}
{tab.id === 'Log & Riwayat' && <FileText className="w-3.5 h-3.5" />}
<span>{tab.label}</span>
</button>
);
})}
</div>
</div>
{/* ========================================================= */}
{/* 3. TAB CONTENT: RINGKASAN */}
{/* ========================================================= */}
{activeTab === 'Ringkasan' && (
<div className="space-y-5 animate-in fade-in duration-150">
{/* ROW 1: 5 KPI METRIC CARDS */}
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3.5">
{/* Metric 1: Total Pendapatan */}
<div className="bg-white p-4 rounded-2xl border border-slate-200/80 shadow-2xs flex items-center gap-3">
<div className="w-10 h-10 rounded-2xl bg-emerald-50 text-emerald-600 flex items-center justify-center shrink-0 border border-emerald-100">
<CreditCard className="w-5 h-5" />
</div>
<div className="min-w-0">
<span className="text-[11px] font-bold text-slate-500 block">Total Pendapatan</span>
<span className="text-lg font-black text-slate-900 leading-tight block">Rp7.188.000</span>
<span className="text-[10px] text-slate-400 block truncate">Total dari tenant ini</span>
<span className="text-[10px] font-bold text-emerald-600 flex items-center gap-0.5 mt-0.5">
↑ 18.6% <span className="text-slate-400 font-normal">vs bulan lalu</span>
</span>
</div>
</div>
{/* Metric 2: Total Reservasi */}
<div className="bg-white p-4 rounded-2xl border border-slate-200/80 shadow-2xs flex items-center gap-3">
<div className="w-10 h-10 rounded-2xl bg-purple-50 text-purple-600 flex items-center justify-center shrink-0 border border-purple-100">
<Calendar className="w-5 h-5" />
</div>
<div className="min-w-0">
<span className="text-[11px] font-bold text-slate-500 block">Total Reservasi</span>
<span className="text-xl font-black text-slate-900 leading-tight block">256</span>
<span className="text-[10px] text-slate-400 block truncate">Reservasi dibuat</span>
<span className="text-[10px] font-bold text-emerald-600 flex items-center gap-0.5 mt-0.5">
~ 12.5% <span className="text-slate-400 font-normal">vs bulan lalu</span>
</span>
</div>
</div>
{/* Metric 3: Total Layanan */}
<div className="bg-white p-4 rounded-2xl border border-slate-200/80 shadow-2xs flex items-center gap-3">
<div className="w-10 h-10 rounded-2xl bg-blue-50 text-blue-600 flex items-center justify-center shrink-0 border border-blue-100">
<CheckCircle2 className="w-5 h-5" />
</div>
<div className="min-w-0">
<span className="text-[11px] font-bold text-slate-500 block">Total Layanan</span>
<span className="text-xl font-black text-slate-900 leading-tight block">24</span>
<span className="text-[10px] text-slate-400 block truncate">Layanan aktif</span>
<span className="text-[10px] font-bold text-emerald-600 flex items-center gap-0.5 mt-0.5">
~ 8.3% <span className="text-slate-400 font-normal">vs bulan lalu</span>
</span>
</div>
</div>
{/* Metric 4: Total Pelanggan */}
<div className="bg-white p-4 rounded-2xl border border-slate-200/80 shadow-2xs flex items-center gap-3">
<div className="w-10 h-10 rounded-2xl bg-amber-50 text-amber-600 flex items-center justify-center shrink-0 border border-amber-100">
<User className="w-5 h-5" />
</div>
<div className="min-w-0">
<span className="text-[11px] font-bold text-slate-500 block">Total Pelanggan</span>
<span className="text-xl font-black text-slate-900 leading-tight block">178</span>
<span className="text-[10px] text-slate-400 block truncate">Pelanggan terdaftar</span>
<span className="text-[10px] font-bold text-emerald-600 flex items-center gap-0.5 mt-0.5">
~ 15.2% <span className="text-slate-400 font-normal">vs bulan lalu</span>
</span>
</div>
</div>
{/* Metric 5: Total Pengguna */}
<div className="bg-white p-4 rounded-2xl border border-slate-200/80 shadow-2xs flex items-center gap-3">
<div className="w-10 h-10 rounded-2xl bg-pink-50 text-[#EC167F] flex items-center justify-center shrink-0 border border-pink-100">
<Users className="w-5 h-5" />
</div>
<div className="min-w-0">
<span className="text-[11px] font-bold text-slate-500 block">Total Pengguna</span>
<span className="text-xl font-black text-slate-900 leading-tight block">8</span>
<span className="text-[10px] text-slate-400 block truncate">Akun pengguna aktif</span>
<span className="text-[10px] font-bold text-emerald-600 flex items-center gap-0.5 mt-0.5">
~ 3 <span className="text-slate-400 font-normal">sejak bulan lalu</span>
</span>
</div>
</div>
</div>
{/* ROW 2: 3 COLUMNS GRID */}
<div className="grid grid-cols-1 md:grid-cols-3 gap-5">
{/* COL 1: INFORMASI BISNIS */}
<div className="bg-white rounded-2xl border border-slate-200/80 shadow-2xs p-5 flex flex-col justify-between space-y-4">
<div>
<h3 className="text-sm font-black text-slate-900 mb-4 pb-2 border-b border-slate-100">
Informasi Bisnis
</h3>
<div className="space-y-3.5 text-xs">
<div>
<span className="text-slate-400 block text-[11px]">Nama Bisnis</span>
<strong className="text-slate-900 font-bold block">Glow Bridal Studio</strong>
</div>
<div>
<span className="text-slate-400 block text-[11px]">Industri</span>
<strong className="text-slate-900 font-bold block">Wedding & Beauty</strong>
</div>
<div>
<span className="text-slate-400 block text-[11px]">Alamat</span>
<p className="text-slate-800 font-medium leading-snug">
Jl. Sudirman No. 123, Jakarta Pusat, DKI Jakarta 10220
</p>
</div>
<div>
<span className="text-slate-400 block text-[11px]">Deskripsi</span>
<p className="text-slate-600 text-[11px] leading-relaxed">
Penyedia jasa rias pengantin profesional dengan layanan lengkap untuk hari spesial Anda.
</p>
</div>
<div>
<span className="text-slate-400 block text-[11px] mb-1">Logo</span>
<div className="flex items-center gap-2">
<div className="w-8 h-8 rounded-full bg-black text-white text-[9px] font-serif italic flex items-center justify-center font-bold">
Glow
</div>
<button
onClick={() => triggerToast('Membuka logo tenant')}
className="px-2.5 py-1 bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold text-[11px] rounded-lg transition-colors cursor-pointer"
>
Lihat Logo
</button>
</div>
</div>
<div className="pt-2 border-t border-slate-100 text-[11px]">
<span className="text-slate-400 block">Dibuat Pada</span>
<strong className="text-slate-800 block">10 Mei 2025, 09:24</strong>
</div>
<div className="text-[11px]">
<span className="text-slate-400 block">Dibuat Oleh</span>
<strong className="text-slate-800 block">Dewi Lestari (Owner)</strong>
</div>
<div className="text-[11px]">
<span className="text-slate-400 block">Terakhir Diperbarui</span>
<strong className="text-slate-800 block">20 Mei 2025, 16:30 oleh Dewi Lestari</strong>
</div>
</div>
</div>
</div>
{/* COL 2: PENGGUNAAN FITUR */}
<div className="bg-white rounded-2xl border border-slate-200/80 shadow-2xs p-5 flex flex-col justify-between space-y-4">
<div>
<div className="mb-4 pb-2 border-b border-slate-100">
<h3 className="text-sm font-black text-slate-900">Penggunaan Fitur</h3>
<p className="text-[11px] text-slate-400 font-medium">Detail penggunaan fitur oleh tenant ini</p>
</div>
<div className="space-y-3.5 text-xs">
{/* Item 1: Reservasi */}
<div className="space-y-1">
<div className="flex justify-between items-center text-[11px]">
<span className="font-bold text-slate-700 flex items-center gap-1.5">
<Calendar className="w-3.5 h-3.5 text-purple-600" />
Reservasi
</span>
<span className="font-bold text-slate-900">256 / ∞</span>
</div>
<div className="w-full bg-slate-100 h-2 rounded-full overflow-hidden">
<div className="bg-purple-600 h-full rounded-full" style={{ width: '65%' }}></div>
</div>
</div>
{/* Item 2: Layanan */}
<div className="space-y-1">
<div className="flex justify-between items-center text-[11px]">
<span className="font-bold text-slate-700 flex items-center gap-1.5">
<Layers className="w-3.5 h-3.5 text-blue-600" />
Layanan
</span>
<span className="font-bold text-slate-900">24 / ∞</span>
</div>
<div className="w-full bg-slate-100 h-2 rounded-full overflow-hidden">
<div className="bg-blue-600 h-full rounded-full" style={{ width: '40%' }}></div>
</div>
</div>
{/* Item 3: Pelanggan (CRM) */}
<div className="space-y-1">
<div className="flex justify-between items-center text-[11px]">
<span className="font-bold text-slate-700 flex items-center gap-1.5">
<UserCheck className="w-3.5 h-3.5 text-emerald-600" />
Pelanggan (CRM)
</span>
<span className="font-bold text-slate-900">178 / ∞</span>
</div>
<div className="w-full bg-slate-100 h-2 rounded-full overflow-hidden">
<div className="bg-emerald-600 h-full rounded-full" style={{ width: '55%' }}></div>
</div>
</div>
{/* Item 4: Website Builder */}
<div className="space-y-1">
<div className="flex justify-between items-center text-[11px]">
<span className="font-bold text-slate-700 flex items-center gap-1.5">
<Globe className="w-3.5 h-3.5 text-orange-500" />
Website Builder
</span>
<span className="font-bold text-slate-900">1 / 1</span>
</div>
<div className="w-full bg-slate-100 h-2 rounded-full overflow-hidden">
<div className="bg-orange-500 h-full rounded-full" style={{ width: '100%' }}></div>
</div>
</div>
{/* Item 5: Penyimpanan */}
<div className="space-y-1">
<div className="flex justify-between items-center text-[11px]">
<span className="font-bold text-slate-700 flex items-center gap-1.5">
<HardDrive className="w-3.5 h-3.5 text-pink-600" />
Penyimpanan
</span>
<span className="font-bold text-slate-900">2.4 GB / 10 GB</span>
</div>
<div className="w-full bg-slate-100 h-2 rounded-full overflow-hidden">
<div className="bg-pink-600 h-full rounded-full" style={{ width: '24%' }}></div>
</div>
</div>
{/* Item 6: Email Marketing */}
<div className="space-y-1">
<div className="flex justify-between items-center text-[11px]">
<span className="font-bold text-slate-700 flex items-center gap-1.5">
<Send className="w-3.5 h-3.5 text-slate-600" />
Email Marketing
</span>
<span className="font-bold text-slate-900">120 / 1.000</span>
</div>
<div className="w-full bg-slate-100 h-2 rounded-full overflow-hidden">
<div className="bg-slate-600 h-full rounded-full" style={{ width: '12%' }}></div>
</div>
</div>
{/* Item 7: Automasi */}
<div className="space-y-1">
<div className="flex justify-between items-center text-[11px]">
<span className="font-bold text-slate-700 flex items-center gap-1.5">
<Zap className="w-3.5 h-3.5 text-indigo-600" />
Automasi
</span>
<span className="font-bold text-slate-900">8 / ∞</span>
</div>
<div className="w-full bg-slate-100 h-2 rounded-full overflow-hidden">
<div className="bg-indigo-600 h-full rounded-full" style={{ width: '30%' }}></div>
</div>
</div>
</div>
</div>
{/* Bottom Link Button */}
<button
onClick={() => setActiveTab('Penggunaan Fitur')}
className="w-full py-2 bg-pink-50 hover:bg-pink-100 text-[#EC167F] font-extrabold text-xs rounded-xl transition-colors cursor-pointer flex items-center justify-center gap-1"
>
<span>Lihat Semua Penggunaan Fitur</span>
<ArrowRight className="w-3.5 h-3.5" />
</button>
</div>
{/* COL 3: AKTIVITAS TERBARU */}
<div className="bg-white rounded-2xl border border-slate-200/80 shadow-2xs p-5 flex flex-col justify-between space-y-4">
<div>
<h3 className="text-sm font-black text-slate-900 mb-4 pb-2 border-b border-slate-100">
Aktivitas Terbaru
</h3>
<div className="space-y-4 text-xs">
{/* Activity 1 */}
<div className="flex items-start gap-3">
<div className="w-8 h-8 rounded-full bg-emerald-50 text-emerald-600 flex items-center justify-center shrink-0 border border-emerald-100 mt-0.5">
<UserCheck className="w-4 h-4" />
</div>
<div className="flex-1 min-w-0">
<div className="flex items-center justify-between gap-1">
<strong className="text-slate-900 font-bold block text-[11px] truncate">Dewi Lestari menambahkan pengguna baru</strong>
<span className="text-[10px] text-slate-400 shrink-0">10 menit lalu</span>
</div>
<span className="text-[10px] text-slate-500 block">Pengguna: Rina Marlina</span>
</div>
</div>
{/* Activity 2 */}
<div className="flex items-start gap-3">
<div className="w-8 h-8 rounded-full bg-blue-50 text-blue-600 flex items-center justify-center shrink-0 border border-blue-100 mt-0.5">
<Calendar className="w-4 h-4" />
</div>
<div className="flex-1 min-w-0">
<div className="flex items-center justify-between gap-1">
<strong className="text-slate-900 font-bold block text-[11px] truncate">Reservasi baru dibuat</strong>
<span className="text-[10px] text-slate-400 shrink-0">30 menit lalu</span>
</div>
<span className="text-[10px] text-slate-500 block">Reservasi #RSV-250520-0128</span>
</div>
</div>
{/* Activity 3 */}
<div className="flex items-start gap-3">
<div className="w-8 h-8 rounded-full bg-amber-50 text-amber-600 flex items-center justify-center shrink-0 border border-amber-100 mt-0.5">
<CreditCard className="w-4 h-4" />
</div>
<div className="flex-1 min-w-0">
<div className="flex items-center justify-between gap-1">
<strong className="text-slate-900 font-bold block text-[11px] truncate">Pembayaran berhasil</strong>
<span className="text-[10px] text-slate-400 shrink-0">1 jam lalu</span>
</div>
<span className="text-[10px] text-slate-500 block">Invoice #INV-2025-0567</span>
</div>
</div>
{/* Activity 4 */}
<div className="flex items-start gap-3">
<div className="w-8 h-8 rounded-full bg-purple-50 text-purple-600 flex items-center justify-center shrink-0 border border-purple-100 mt-0.5">
<Edit className="w-4 h-4" />
</div>
<div className="flex-1 min-w-0">
<div className="flex items-center justify-between gap-1">
<strong className="text-slate-900 font-bold block text-[11px] truncate">Data layanan diperbarui</strong>
<span className="text-[10px] text-slate-400 shrink-0">2 jam lalu</span>
</div>
<span className="text-[10px] text-slate-500 block">Layanan: Paket Wedding Glam</span>
</div>
</div>
{/* Activity 5 */}
<div className="flex items-start gap-3">
<div className="w-8 h-8 rounded-full bg-pink-50 text-[#EC167F] flex items-center justify-center shrink-0 border border-pink-100 mt-0.5">
<Globe className="w-4 h-4" />
</div>
<div className="flex-1 min-w-0">
<div className="flex items-center justify-between gap-1">
<strong className="text-slate-900 font-bold block text-[11px] truncate">Domain dihubungkan</strong>
<span className="text-[10px] text-slate-400 shrink-0">3 jam lalu</span>
</div>
<span className="text-[10px] text-slate-500 block">Domain: glowbridal.com</span>
</div>
</div>
</div>
</div>
{/* Bottom Link Button */}
<button
onClick={() => setActiveTab('Aktivitas')}
className="w-full py-2 bg-pink-50 hover:bg-pink-100 text-[#EC167F] font-extrabold text-xs rounded-xl transition-colors cursor-pointer flex items-center justify-center gap-1"
>
<span>Lihat Semua Aktivitas</span>
<ArrowRight className="w-3.5 h-3.5" />
</button>
</div>
</div>
{/* ROW 3: BOTTOM GRID (DOMAIN & AKSES + AKSI CEPAT) */}
<div className="grid grid-cols-1 lg:grid-cols-12 gap-5">
{/* Left Card: Domain & Akses (Spans 8 columns) */}
<div className="lg:col-span-8 bg-white rounded-2xl border border-slate-200/80 shadow-2xs p-5 space-y-4">
<h3 className="text-sm font-black text-slate-900 pb-2 border-b border-slate-100">
Domain & Akses
</h3>
<div className="grid grid-cols-1 md:grid-cols-3 gap-5 text-xs">
{/* Domain Items */}
<div className="space-y-3 md:col-span-1 border-r-0 md:border-r border-slate-100 md:pr-4">
<div>
<span className="text-slate-400 block text-[11px] mb-1">Domain Utama</span>
<strong className="text-slate-900 block text-xs">glowbridal.muakita.com</strong>
<div className="flex items-center gap-1.5 mt-1">
<span className="px-2 py-0.5 rounded-full text-[10px] font-bold bg-emerald-100 text-emerald-700">Aktif</span>
<span className="px-2 py-0.5 rounded-full text-[10px] font-bold bg-emerald-100 text-emerald-700">SSL Aktif</span>
</div>
</div>
<div className="pt-2 border-t border-slate-100">
<span className="text-slate-400 block text-[11px] mb-1">Custom Domain</span>
<strong className="text-slate-900 block text-xs">glowbridal.com</strong>
<div className="flex items-center gap-1.5 mt-1">
<span className="px-2 py-0.5 rounded-full text-[10px] font-bold bg-emerald-100 text-emerald-700">Terverifikasi</span>
<span className="px-2 py-0.5 rounded-full text-[10px] font-bold bg-emerald-100 text-emerald-700">SSL Aktif</span>
</div>
</div>
</div>
{/* Login Info */}
<div className="space-y-3 md:col-span-1 border-r-0 md:border-r border-slate-100 md:pr-4">
<div>
<span className="text-slate-400 block text-[11px] mb-1">Akses Login</span>
<div className="flex items-center gap-1">
<span className="font-semibold text-slate-800 text-xs truncate">glowbridal.muakita.com/login</span>
<button
onClick={() => handleCopy('https://glowbridal.muakita.com/login', 'Akses Login URL')}
className="p-1 text-slate-400 hover:text-slate-600 transition-colors cursor-pointer"
>
<Copy className="w-3.5 h-3.5" />
</button>
</div>
</div>
<div className="pt-2 border-t border-slate-100">
<span className="text-slate-400 block text-[11px]">Login Terakhir</span>
<strong className="text-slate-900 block text-xs">20 Mei 2025, 10:24</strong>
<span className="text-[10px] text-slate-400 block">IP: 180.241.***.**</span>
</div>
</div>
{/* Security Policy */}
<div className="space-y-2 md:col-span-1">
<span className="text-slate-400 block text-[11px] font-bold mb-1">Keamanan</span>
<div className="flex items-center justify-between text-[11px]">
<span className="text-slate-600">2FA untuk semua user</span>
<span className="font-bold text-emerald-600">Wajib</span>
</div>
<div className="flex items-center justify-between text-[11px]">
<span className="text-slate-600">Password Policy</span>
<span className="font-bold text-emerald-600">Aktif</span>
</div>
<div className="flex items-center justify-between text-[11px]">
<span className="text-slate-600">Login Percobaan Gagal</span>
<span className="font-bold text-emerald-600">0 percobaan</span>
</div>
</div>
</div>
</div>
{/* Right Card: Aksi Cepat (Spans 4 columns) */}
<div className="lg:col-span-4 bg-white rounded-2xl border border-slate-200/80 shadow-2xs p-5 space-y-3">
<h3 className="text-sm font-black text-slate-900 pb-2 border-b border-slate-100">
Aksi Cepat
</h3>
<div className="space-y-2.5">
{/* Action 1: Masuk sebagai Tenant */}
<button
onClick={() => triggerToast('Dialihkan ke dashboard tenant Glow Bridal Studio...')}
className="w-full py-2.5 px-4 bg-pink-50/90 hover:bg-pink-100 text-[#EC167F] font-extrabold text-xs rounded-xl transition-all cursor-pointer flex items-center justify-center gap-2 border border-pink-100 active:scale-98"
>
<LogIn className="w-4 h-4" />
<span>Masuk sebagai Tenant</span>
</button>
{/* Action 2: Reset Password Owner */}
<button
onClick={() => triggerToast('Link reset password dikirim ke dewilestari@gmail.com')}
className="w-full py-2.5 px-4 bg-white hover:bg-slate-50 text-slate-700 font-bold text-xs rounded-xl transition-all cursor-pointer flex items-center justify-center gap-2 border border-slate-200 shadow-2xs"
>
<Key className="w-4 h-4 text-slate-500" />
<span>Reset Password Owner</span>
</button>
{/* Action 3: Hapus Tenant */}
<button
onClick={() => triggerToast('Peringatan: Konfirmasi hapus tenant')}
className="w-full py-2.5 px-4 bg-white hover:bg-rose-50 text-rose-600 font-bold text-xs rounded-xl transition-all cursor-pointer flex items-center justify-center gap-2 border border-rose-200"
>
<Trash2 className="w-4 h-4" />
<span>Hapus Tenant</span>
</button>
</div>
</div>
</div>
</div>
)}
{/* ========================================================= */}
{/* 4. OTHER TABS (Pengguna, Paket & Billing, Domain & Akses, Fitur, Aktivitas, Log) */}
{/* ========================================================= */}
{activeTab !== 'Ringkasan' && (
<div className="bg-white rounded-2xl border border-slate-200/80 shadow-2xs p-6 animate-in fade-in duration-150 space-y-4">
<div className="flex items-center justify-between pb-3 border-b border-slate-100">
<div>
<h3 className="text-base font-black text-slate-900">{activeTab}</h3>
<p className="text-xs text-slate-500 font-medium">Manajemen data {activeTab.toLowerCase()} untuk Glow Bridal Studio</p>
</div>
<button
onClick={() => triggerToast(`Menampilkan laporan ${activeTab}`)}
className="px-3.5 py-1.5 bg-slate-900 text-white rounded-xl text-xs font-bold hover:bg-slate-800 transition-colors cursor-pointer"
>
Export Data
</button>
</div>
{activeTab === 'Pengguna' && (
<div className="space-y-3">
<div className="flex justify-between items-center bg-slate-50 p-3 rounded-xl">
<span className="text-xs font-bold text-slate-700">Daftar User Staff Tenant (8 User)</span>
<button onClick={() => triggerToast('Tambah user baru')} className="text-xs font-bold text-[#EC167F] hover:underline">+ Tambah User</button>
</div>
<div className="divide-y divide-slate-100 text-xs">
{[
{ name: 'Dewi Lestari', role: 'Owner / Super Admin', email: 'dewilestari@gmail.com', status: 'Aktif' },
{ name: 'Rina Marlina', role: 'Staff MUA Lead', email: 'rina.marlina@gmail.com', status: 'Aktif' },
{ name: 'Siti Rahma', role: 'Kasir & Admin Reservasi', email: 'siti.rahma@gmail.com', status: 'Aktif' },
{ name: 'Budi Santoso', role: 'Fotografer Partner', email: 'budi.santoso@gmail.com', status: 'Aktif' },
{ name: 'Maya Indah', role: 'Hair Stylist Senior', email: 'maya.indah@gmail.com', status: 'Aktif' },
{ name: 'Andi Wijaya', role: 'Staff Inventory', email: 'andi.wijaya@gmail.com', status: 'Aktif' },
].map((user, idx) => (
<div key={idx} className="py-2.5 flex items-center justify-between">
<div className="flex items-center gap-3">
<div className="w-8 h-8 rounded-full bg-pink-100 text-[#EC167F] font-black flex items-center justify-center text-xs">
{user.name.charAt(0)}
</div>
<div>
<span className="font-bold text-slate-900 block">{user.name}</span>
<span className="text-[11px] text-slate-400">{user.email} • {user.role}</span>
</div>
</div>
<span className="px-2 py-0.5 rounded bg-emerald-100 text-emerald-700 text-[10px] font-bold">{user.status}</span>
</div>
))}
</div>
</div>
)}
{activeTab === 'Paket & Billing' && (
<div className="space-y-4 text-xs">
<div className="p-4 bg-purple-50 border border-purple-100 rounded-2xl flex items-center justify-between">
<div>
<span className="text-purple-600 text-[10px] font-black uppercase tracking-wider block">Paket Saat Ini</span>
<h4 className="text-lg font-black text-purple-900">Enterprise Plan</h4>
<p className="text-slate-600 text-xs">Rp599.000 / bulan • Penagihan Otomatis Kartu Kredit</p>
</div>
<button onClick={() => triggerToast('Ubah paket langganan')} className="px-4 py-2 bg-[#EC167F] text-white font-bold rounded-xl shadow-2xs hover:bg-[#D41270]">
Upgrade / Ubah Paket
</button>
</div>
<h4 className="font-bold text-slate-800 text-sm">Riwayat Tagihan & Invoice</h4>
<div className="divide-y divide-slate-100">
{[
{ inv: '#INV-2025-0567', date: '10 Mei 2025', amount: 'Rp599.000', status: 'Lunas' },
{ inv: '#INV-2025-0452', date: '10 Apr 2025', amount: 'Rp599.000', status: 'Lunas' },
{ inv: '#INV-2025-0321', date: '10 Mar 2025', amount: 'Rp599.000', status: 'Lunas' },
].map((bill, i) => (
<div key={i} className="py-2.5 flex items-center justify-between">
<div>
<span className="font-bold text-slate-900 block">{bill.inv}</span>
<span className="text-[11px] text-slate-400">{bill.date}</span>
</div>
<div className="text-right">
<span className="font-black text-slate-900 block">{bill.amount}</span>
<span className="text-emerald-600 font-bold text-[10px]">{bill.status}</span>
</div>
</div>
))}
</div>
</div>
)}
{activeTab !== 'Pengguna' && activeTab !== 'Paket & Billing' && (
<div className="py-8 text-center text-slate-400 text-xs space-y-2">
<Layers className="w-8 h-8 mx-auto text-slate-300" />
<p className="font-bold text-slate-600">Menampilkan detail data untuk tab {activeTab}</p>
<p className="text-[11px] text-slate-400">Semua pengaturan dan log tersimpan dengan aman pada sistem MuaKita.</p>
</div>
)}
</div>
)}
</div>
);
};