%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/ReservasiView.tsx |
import React, { useState } from 'react';
import {
Search, Calendar, ChevronDown, Download, Upload, Filter,
RotateCcw, Eye, MoreVertical, CheckCircle2, Clock,
CreditCard, UserPlus, CalendarDays, MapPin, ArrowUp, Plus
} from 'lucide-react';
import { Reservation } from '../../types';
interface ReservasiViewProps {
reservations: Reservation[];
onNavigateToCreate?: () => void;
triggerToast: (msg: string) => void;
}
interface DetailedReservationItem {
id: string;
code: string;
createdAt: string;
clientName: string;
clientPhone: string;
clientAvatar: string;
eventDate: string;
eventTime: string;
location: string;
serviceTitle: string;
serviceDetail: string;
addOnCount?: number;
teamAvatars: { name: string; url: string }[];
totalPrice: string;
status: 'DP Masuk' | 'Lunas' | 'Draft' | 'Inquiry' | 'Selesai' | 'Dibatalkan';
paymentStatus: string;
}
const mockDetailedReservations: DetailedReservationItem[] = [
{
id: '1',
code: 'RSV-250621-0128',
createdAt: '26 Mei 2025',
clientName: 'Reza Amelia',
clientPhone: '0812 3456 7890',
clientAvatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?auto=format&fit=crop&q=80&w=120',
eventDate: '26 Jun 2025',
eventTime: '09.00',
location: 'The Westin Jakarta',
serviceTitle: 'Wedding Makeup',
serviceDetail: '1 Orang • Paket Premium',
addOnCount: 2,
teamAvatars: [
{ name: 'Siti R.', url: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?auto=format&fit=crop&q=80&w=120' }
],
totalPrice: 'Rp2.500.000',
status: 'DP Masuk',
paymentStatus: 'DP Rp500.000',
},
{
id: '2',
code: 'RSV-250620-0127',
createdAt: '25 Mei 2025',
clientName: 'Anisa Rahma',
clientPhone: '0813 2222 3333',
clientAvatar: 'https://images.unsplash.com/photo-1517841905240-472988babdf9?auto=format&fit=crop&q=80&w=120',
eventDate: '25 Jun 2025',
eventTime: '10.00',
location: 'Gedung Graha Satria',
serviceTitle: 'Engagement Makeup',
serviceDetail: '1 Orang • Paket Basic',
teamAvatars: [
{ name: 'Siti R.', url: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?auto=format&fit=crop&q=80&w=120' },
{ name: 'Dian P.', url: 'https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?auto=format&fit=crop&q=80&w=120' }
],
totalPrice: 'Rp1.200.000',
status: 'Lunas',
paymentStatus: 'Lunas',
},
{
id: '3',
code: 'RSV-250620-0126',
createdAt: '24 Mei 2025',
clientName: 'Maya Salsabila',
clientPhone: '0812 9999 8888',
clientAvatar: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&q=80&w=120',
eventDate: '24 Jun 2025',
eventTime: '13.00',
location: 'Hotel Mulia Jakarta',
serviceTitle: 'Hairdo',
serviceDetail: '2 Orang',
teamAvatars: [
{ name: 'Dian P.', url: 'https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?auto=format&fit=crop&q=80&w=120' }
],
totalPrice: 'Rp800.000',
status: 'Draft',
paymentStatus: 'Belum Bayar',
},
{
id: '4',
code: 'RSV-250619-0125',
createdAt: '23 Mei 2025',
clientName: 'Clara Dewi',
clientPhone: '0813 4444 5555',
clientAvatar: 'https://images.unsplash.com/photo-1524504388940-b1c1722653e1?auto=format&fit=crop&q=80&w=120',
eventDate: '23 Jun 2025',
eventTime: '08.00',
location: 'Hotel Fairmont',
serviceTitle: 'Wedding Makeup',
serviceDetail: '1 Orang • Paket Premium',
addOnCount: 1,
teamAvatars: [
{ name: 'Siti R.', url: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?auto=format&fit=crop&q=80&w=120' },
{ name: 'Dian P.', url: 'https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?auto=format&fit=crop&q=80&w=120' }
],
totalPrice: 'Rp2.750.000',
status: 'Inquiry',
paymentStatus: '-',
},
{
id: '5',
code: 'RSV-250618-0124',
createdAt: '22 Mei 2025',
clientName: 'Fahira Nur',
clientPhone: '0812 7777 6666',
clientAvatar: 'https://images.unsplash.com/photo-1508214751196-bcfd4ca60f91?auto=format&fit=crop&q=80&w=120',
eventDate: '22 Jun 2025',
eventTime: '09.30',
location: 'Gedung Serbaguna',
serviceTitle: 'Makeup & Hairdo',
serviceDetail: '3 Orang',
teamAvatars: [
{ name: 'Siti R.', url: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?auto=format&fit=crop&q=80&w=120' },
{ name: 'Dian P.', url: 'https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?auto=format&fit=crop&q=80&w=120' },
{ name: 'Rina T.', url: 'https://images.unsplash.com/photo-1580489944761-15a19d654956?auto=format&fit=crop&q=80&w=120' }
],
totalPrice: 'Rp1.950.000',
status: 'DP Masuk',
paymentStatus: 'DP Rp750.000',
},
{
id: '6',
code: 'RSV-250617-0123',
createdAt: '21 Mei 2025',
clientName: 'Nadia Putri',
clientPhone: '0812 1212 1212',
clientAvatar: 'https://images.unsplash.com/photo-1531746020798-e6953c6e8e04?auto=format&fit=crop&q=80&w=120',
eventDate: '21 Jun 2025',
eventTime: '11.00',
location: 'The Ritz Carlton',
serviceTitle: 'Prewedding Makeup',
serviceDetail: '1 Orang • Paket Basic',
teamAvatars: [
{ name: 'Siti R.', url: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?auto=format&fit=crop&q=80&w=120' }
],
totalPrice: 'Rp1.500.000',
status: 'Selesai',
paymentStatus: 'Lunas',
},
{
id: '7',
code: 'RSV-250617-0122',
createdAt: '20 Mei 2025',
clientName: 'Dewi Anggraini',
clientPhone: '0813 9898 7878',
clientAvatar: 'https://images.unsplash.com/photo-1567532939604-b6b5b0db2604?auto=format&fit=crop&q=80&w=120',
eventDate: '20 Jun 2025',
eventTime: '07.00',
location: 'Rumah Client',
serviceTitle: 'Makeup',
serviceDetail: '1 Orang',
teamAvatars: [
{ name: 'Siti R.', url: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?auto=format&fit=crop&q=80&w=120' }
],
totalPrice: 'Rp600.000',
status: 'Dibatalkan',
paymentStatus: 'Refund',
}
];
export const ReservasiView: React.FC<ReservasiViewProps> = ({
reservations = [],
onNavigateToCreate,
triggerToast
}) => {
const [activePill, setActivePill] = useState<string>('Semua');
const [searchQuery, setSearchQuery] = useState('');
const [selectedStatus, setSelectedStatus] = useState('Semua Status');
const [selectedService, setSelectedService] = useState('Semua Layanan');
const [selectedTeam, setSelectedTeam] = useState('Semua Tim');
const [selectedRows, setSelectedRows] = useState<string[]>([]);
// Map incoming dynamic reservations if any
const dynamicReservations: DetailedReservationItem[] = (reservations || []).map((r, idx) => ({
id: r.id || `custom-${idx}`,
code: `RSV-250628-0${130 + idx}`,
createdAt: 'Hari ini',
clientName: r.name || 'Pelanggan Baru',
clientPhone: '0812 8888 9999',
clientAvatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?auto=format&fit=crop&q=80&w=120',
eventDate: r.date || '28 Jun 2025',
eventTime: '09.00',
location: 'Jakarta',
serviceTitle: r.service || 'Wedding Makeup',
serviceDetail: '1 Orang • Booking Baru',
teamAvatars: [
{ name: 'Siti R.', url: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?auto=format&fit=crop&q=80&w=120' }
],
totalPrice: 'Rp2.500.000',
status: (r.status === 'Dikonfirmasi' ? 'DP Masuk' : r.status === 'Menunggu DP' ? 'Inquiry' : 'Draft') as any,
paymentStatus: r.payment || 'DP Rp500.000',
}));
const allReservations = [...dynamicReservations, ...mockDetailedReservations];
const filteredData = allReservations.filter(item => {
const matchesSearch =
item.clientName.toLowerCase().includes(searchQuery.toLowerCase()) ||
item.clientPhone.includes(searchQuery) ||
item.code.toLowerCase().includes(searchQuery.toLowerCase()) ||
item.serviceTitle.toLowerCase().includes(searchQuery.toLowerCase());
const matchesPill =
activePill === 'Semua' ||
item.status === activePill;
return matchesSearch && matchesPill;
});
const toggleSelectAll = () => {
if (selectedRows.length === filteredData.length) {
setSelectedRows([]);
} else {
setSelectedRows(filteredData.map(d => d.id));
}
};
const toggleSelectRow = (id: string) => {
setSelectedRows(prev =>
prev.includes(id) ? prev.filter(r => r !== id) : [...prev, id]
);
};
return (
<div className="space-y-4 animate-in fade-in duration-200 text-slate-800">
{/* 1. Header Row */}
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-3">
<div>
<h1 className="text-xl font-extrabold text-slate-900 tracking-tight">Daftar Reservasi</h1>
<p className="text-xs text-slate-500 font-medium">Kelola semua reservasi dan booking dalam satu tempat</p>
</div>
<div className="flex items-center gap-2 flex-wrap">
<button
onClick={() => triggerToast("Mengeksport data reservasi...")}
className="px-3 py-1.5 bg-white hover:bg-slate-50 text-slate-700 border border-slate-200/90 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 shadow-2xs cursor-pointer"
>
<Download className="w-3.5 h-3.5 text-slate-500" />
<span>Export</span>
</button>
<button
onClick={() => triggerToast("Mengimpor data reservasi...")}
className="px-3 py-1.5 bg-white hover:bg-slate-50 text-slate-700 border border-slate-200/90 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 shadow-2xs cursor-pointer"
>
<Upload className="w-3.5 h-3.5 text-slate-500" />
<span>Import</span>
</button>
<button
onClick={() => triggerToast("Buka filter lanjutan")}
className="px-3 py-1.5 bg-white hover:bg-slate-50 text-slate-700 border border-slate-200/90 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 shadow-2xs cursor-pointer"
>
<Filter className="w-3.5 h-3.5 text-slate-500" />
<span>Filter Lanjutan</span>
<ChevronDown className="w-3.5 h-3.5 text-slate-400 ml-0.5" />
</button>
{onNavigateToCreate && (
<button
onClick={onNavigateToCreate}
className="px-3.5 py-1.5 bg-[#EC167F] hover:bg-[#D41270] text-white rounded-xl text-xs font-extrabold shadow-xs transition-all flex items-center gap-1.5 cursor-pointer ml-1"
>
<Plus className="w-4 h-4" />
<span>Tambah Reservasi</span>
</button>
)}
</div>
</div>
{/* 2. Top Summary Metrics Cards (5 Cards) */}
<div className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3">
{/* Card 1 */}
<div className="bg-white p-3.5 rounded-2xl border border-slate-200/80 shadow-2xs flex flex-col justify-between">
<div className="flex items-center justify-between">
<span className="text-[11px] font-bold text-slate-500">Total Reservasi</span>
<div className="w-7 h-7 rounded-xl bg-pink-50 text-[#EC167F] flex items-center justify-center font-bold">
<CalendarDays className="w-4 h-4" />
</div>
</div>
<div className="mt-2">
<h3 className="text-xl font-black text-slate-900 leading-tight">128</h3>
<p className="text-[10px] font-bold text-emerald-600 flex items-center gap-0.5 mt-1">
<ArrowUp className="w-2.5 h-2.5" /> 18% <span className="font-normal text-slate-400">dari bulan lalu</span>
</p>
</div>
</div>
{/* Card 2 */}
<div className="bg-white p-3.5 rounded-2xl border border-slate-200/80 shadow-2xs flex flex-col justify-between">
<div className="flex items-center justify-between">
<span className="text-[11px] font-bold text-slate-500">Reservasi Aktif</span>
<div className="w-7 h-7 rounded-xl bg-blue-50 text-blue-600 flex items-center justify-center font-bold">
<Clock className="w-4 h-4" />
</div>
</div>
<div className="mt-2">
<h3 className="text-xl font-black text-slate-900 leading-tight">34</h3>
<p className="text-[10px] font-bold text-emerald-600 flex items-center gap-0.5 mt-1">
<ArrowUp className="w-2.5 h-2.5" /> 12% <span className="font-normal text-slate-400">dari bulan lalu</span>
</p>
</div>
</div>
{/* Card 3 */}
<div className="bg-white p-3.5 rounded-2xl border border-slate-200/80 shadow-2xs flex flex-col justify-between">
<div className="flex items-center justify-between">
<span className="text-[11px] font-bold text-slate-500">Reservasi Selesai</span>
<div className="w-7 h-7 rounded-xl bg-purple-50 text-purple-600 flex items-center justify-center font-bold">
<CheckCircle2 className="w-4 h-4" />
</div>
</div>
<div className="mt-2">
<h3 className="text-xl font-black text-slate-900 leading-tight">82</h3>
<p className="text-[10px] font-bold text-emerald-600 flex items-center gap-0.5 mt-1">
<ArrowUp className="w-2.5 h-2.5" /> 25% <span className="font-normal text-slate-400">dari bulan lalu</span>
</p>
</div>
</div>
{/* Card 4 */}
<div className="bg-white p-3.5 rounded-2xl border border-slate-200/80 shadow-2xs flex flex-col justify-between">
<div className="flex items-center justify-between">
<span className="text-[11px] font-bold text-slate-500">Pending Payment</span>
<div className="w-7 h-7 rounded-xl bg-amber-50 text-amber-600 flex items-center justify-center font-bold">
<CreditCard className="w-4 h-4" />
</div>
</div>
<div className="mt-2">
<h3 className="text-xl font-black text-slate-900 leading-tight">16</h3>
<p className="text-[10px] font-bold text-emerald-600 flex items-center gap-0.5 mt-1">
<ArrowUp className="w-2.5 h-2.5" /> 8% <span className="font-normal text-slate-400">dari bulan lalu</span>
</p>
</div>
</div>
{/* Card 5 */}
<div className="bg-white p-3.5 rounded-2xl border border-slate-200/80 shadow-2xs flex flex-col justify-between col-span-2 sm:col-span-1">
<div className="flex items-center justify-between">
<span className="text-[11px] font-bold text-slate-500">Total Pendapatan</span>
<div className="w-7 h-7 rounded-xl bg-emerald-50 text-emerald-600 flex items-center justify-center font-bold">
<UserPlus className="w-4 h-4" />
</div>
</div>
<div className="mt-2">
<h3 className="text-lg font-black text-slate-900 leading-tight truncate">Rp126.500.000</h3>
<p className="text-[10px] font-bold text-emerald-600 flex items-center gap-0.5 mt-1">
<ArrowUp className="w-2.5 h-2.5" /> 18% <span className="font-normal text-slate-400">dari bulan lalu</span>
</p>
</div>
</div>
</div>
{/* 3. Search, Date Range, Filter Dropdowns & Tab Pills Box */}
<div className="bg-white p-3.5 rounded-2xl border border-slate-200/80 shadow-2xs space-y-3">
{/* Top Controls Row */}
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-12 gap-2.5 items-center">
{/* Search Box */}
<div className="lg:col-span-4 relative">
<input
type="text"
placeholder="Cari nama client, no. WhatsApp, layanan..."
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
className="w-full pl-8 pr-3 py-1.5 bg-slate-50 border border-slate-200 rounded-xl text-xs font-medium focus:bg-white focus:outline-none focus:ring-2 focus:ring-pink-500/20 text-slate-800"
/>
<Search className="w-3.5 h-3.5 text-slate-400 absolute left-2.5 top-2.5" />
</div>
{/* Date Range Picker Selector */}
<div className="lg:col-span-3 flex items-center justify-between px-3 py-1.5 bg-slate-50 border border-slate-200 rounded-xl text-xs font-semibold text-slate-700 cursor-pointer hover:bg-slate-100/70 transition-colors">
<span>21 Mei 2025 - 21 Jun 2025</span>
<Calendar className="w-3.5 h-3.5 text-slate-400 shrink-0" />
</div>
{/* Dropdown 1: Semua Status */}
<div className="lg:col-span-2 relative">
<select
value={selectedStatus}
onChange={(e) => setSelectedStatus(e.target.value)}
className="w-full appearance-none px-3 py-1.5 pr-7 bg-slate-50 border border-slate-200 rounded-xl text-xs font-semibold text-slate-700 focus:bg-white focus:outline-none cursor-pointer"
>
<option>Semua Status</option>
<option>DP Masuk</option>
<option>Lunas</option>
<option>Draft</option>
<option>Inquiry</option>
<option>Selesai</option>
<option>Dibatalkan</option>
</select>
<ChevronDown className="w-3.5 h-3.5 text-slate-400 absolute right-2.5 top-2.5 pointer-events-none" />
</div>
{/* Dropdown 2: Semua Layanan */}
<div className="lg:col-span-2 relative">
<select
value={selectedService}
onChange={(e) => setSelectedService(e.target.value)}
className="w-full appearance-none px-3 py-1.5 pr-7 bg-slate-50 border border-slate-200 rounded-xl text-xs font-semibold text-slate-700 focus:bg-white focus:outline-none cursor-pointer"
>
<option>Semua Layanan</option>
<option>Wedding Makeup</option>
<option>Engagement Makeup</option>
<option>Hairdo</option>
<option>Prewedding Makeup</option>
</select>
<ChevronDown className="w-3.5 h-3.5 text-slate-400 absolute right-2.5 top-2.5 pointer-events-none" />
</div>
{/* Reset Button */}
<div className="lg:col-span-1 flex justify-end">
<button
onClick={() => {
setSearchQuery('');
setSelectedStatus('Semua Status');
setSelectedService('Semua Layanan');
setSelectedTeam('Semua Tim');
setActivePill('Semua');
triggerToast("Filter telah di-reset");
}}
className="w-full sm:w-auto px-3 py-1.5 bg-slate-50 hover:bg-slate-100 text-slate-600 border border-slate-200 rounded-xl text-xs font-bold transition-all flex items-center justify-center gap-1 cursor-pointer"
>
<RotateCcw className="w-3 h-3 text-slate-500" />
<span>Reset</span>
</button>
</div>
</div>
{/* Tab Pills Row */}
<div className="flex items-center gap-1.5 overflow-x-auto pt-1 pb-0.5 custom-scrollbar text-xs font-bold">
{[
{ label: 'Semua', count: null },
{ label: 'Draft', count: 8 },
{ label: 'Inquiry', count: 12 },
{ label: 'DP Masuk', count: 16 },
{ label: 'Lunas', count: 68 },
{ label: 'Selesai', count: 82 },
{ label: 'Dibatalkan', count: 4 },
].map((pill) => {
const isActive = activePill === pill.label;
return (
<button
key={pill.label}
onClick={() => setActivePill(pill.label)}
className={`px-3 py-1 rounded-xl transition-all cursor-pointer whitespace-nowrap flex items-center gap-1.5 ${
isActive
? 'bg-[#EC167F] text-white shadow-2xs font-extrabold'
: 'bg-slate-50 hover:bg-slate-100 text-slate-600 font-semibold'
}`}
>
<span>{pill.label}</span>
{pill.count !== null && (
<span className={`text-[10px] px-1.5 py-0.2 rounded-md font-extrabold ${
isActive ? 'bg-white/20 text-white' : 'bg-slate-200/70 text-slate-600'
}`}>
{pill.count}
</span>
)}
</button>
);
})}
</div>
</div>
{/* 4. Reservations Data Table */}
<div className="bg-white rounded-2xl border border-slate-200/80 shadow-2xs overflow-hidden">
<div className="overflow-x-auto custom-scrollbar">
<table className="w-full text-left text-xs">
<thead className="bg-slate-50/80 border-b border-slate-200 text-slate-500 font-bold text-[11px]">
<tr>
<th className="py-3 px-3.5 w-10 text-center">
<input
type="checkbox"
checked={selectedRows.length === filteredData.length && filteredData.length > 0}
onChange={toggleSelectAll}
className="rounded border-slate-300 text-[#EC167F] focus:ring-[#EC167F] cursor-pointer"
/>
</th>
<th className="py-3 px-3 font-bold text-slate-600">ID Reservasi</th>
<th className="py-3 px-3 font-bold text-slate-600">Client</th>
<th className="py-3 px-3 font-bold text-slate-600">Tanggal & Waktu</th>
<th className="py-3 px-3 font-bold text-slate-600">Layanan</th>
<th className="py-3 px-3 font-bold text-slate-600">Tim</th>
<th className="py-3 px-3 font-bold text-slate-600">Total</th>
<th className="py-3 px-3 font-bold text-slate-600">Status</th>
<th className="py-3 px-3 font-bold text-slate-600">Pembayaran</th>
<th className="py-3 px-3 text-center font-bold text-slate-600">Aksi</th>
</tr>
</thead>
<tbody className="divide-y divide-slate-100 text-xs font-medium">
{filteredData.map((row) => {
const isSelected = selectedRows.includes(row.id);
return (
<tr key={row.id} className={`hover:bg-slate-50/80 transition-colors ${isSelected ? 'bg-pink-50/30' : ''}`}>
{/* Checkbox */}
<td className="py-3 px-3.5 text-center">
<input
type="checkbox"
checked={isSelected}
onChange={() => toggleSelectRow(row.id)}
className="rounded border-slate-300 text-[#EC167F] focus:ring-[#EC167F] cursor-pointer"
/>
</td>
{/* ID Reservasi */}
<td className="py-3 px-3">
<span className="font-extrabold text-slate-900 block">{row.code}</span>
<span className="text-[10px] text-slate-400 font-normal">{row.createdAt}</span>
</td>
{/* Client */}
<td className="py-3 px-3">
<div>
<span className="font-extrabold text-slate-900 block leading-tight">{row.clientName}</span>
<span className="text-[10px] text-emerald-600 font-semibold block flex items-center gap-0.5 mt-0.5">
<span className="w-1.5 h-1.5 rounded-full bg-emerald-500 inline-block"></span>
{row.clientPhone}
</span>
</div>
</td>
{/* Tanggal & Waktu */}
<td className="py-3 px-3">
<div className="flex items-start gap-1.5">
<Calendar className="w-3.5 h-3.5 text-slate-400 shrink-0 mt-0.5" />
<div>
<div className="flex items-center gap-1 text-slate-800 font-bold">
<span>{row.eventDate}</span>
<span className="text-slate-400 font-normal">• {row.eventTime}</span>
</div>
<span className="text-[10px] text-slate-400 flex items-center gap-0.5">
<MapPin className="w-2.5 h-2.5 text-slate-400" />
{row.location}
</span>
</div>
</div>
</td>
{/* Layanan */}
<td className="py-3 px-3">
<div>
<span className="font-extrabold text-slate-900 block">{row.serviceTitle}</span>
<div className="flex items-center gap-1 mt-0.5 flex-wrap">
<span className="text-[10px] text-slate-500">{row.serviceDetail}</span>
{row.addOnCount && (
<span className="text-[9px] font-bold text-pink-600 bg-pink-50 px-1 py-0.2 rounded-md">
+{row.addOnCount} Add-On
</span>
)}
</div>
</div>
</td>
{/* Tim */}
<td className="py-3 px-3">
<span className="font-semibold text-slate-700 block">
{row.teamAvatars.map(tm => tm.name).join(', ')}
</span>
</td>
{/* Total */}
<td className="py-3 px-3 font-black text-slate-900 whitespace-nowrap">
{row.totalPrice}
</td>
{/* Status */}
<td className="py-3 px-3 whitespace-nowrap">
<span className={`px-2.5 py-1 rounded-lg text-[10px] font-extrabold inline-block ${
row.status === 'DP Masuk' ? 'bg-blue-100/80 text-blue-700' :
row.status === 'Lunas' ? 'bg-emerald-100/80 text-emerald-800' :
row.status === 'Draft' ? 'bg-slate-100 text-slate-700' :
row.status === 'Inquiry' ? 'bg-purple-100/80 text-purple-700' :
row.status === 'Selesai' ? 'bg-indigo-100/80 text-indigo-700' :
'bg-rose-100/80 text-rose-700'
}`}>
{row.status}
</span>
</td>
{/* Pembayaran */}
<td className="py-3 px-3 whitespace-nowrap">
<span className={`px-2 py-0.5 rounded-md text-[10px] font-bold ${
row.paymentStatus.includes('Lunas') ? 'bg-emerald-50 text-emerald-700' :
row.paymentStatus.includes('DP') ? 'bg-blue-50 text-blue-700' :
row.paymentStatus === 'Belum Bayar' ? 'bg-amber-50 text-amber-700' :
'bg-slate-50 text-slate-500'
}`}>
{row.paymentStatus}
</span>
</td>
{/* Aksi */}
<td className="py-3 px-3 text-center">
<div className="flex items-center justify-center gap-1">
<button
onClick={() => triggerToast(`Melihat detail reservasi ${row.code}`)}
className="p-1.5 rounded-lg hover:bg-slate-100 text-slate-500 hover:text-slate-800 transition-colors cursor-pointer"
title="Lihat Detail"
>
<Eye className="w-3.5 h-3.5" />
</button>
<button
onClick={() => triggerToast(`Opsi tambahan untuk ${row.code}`)}
className="p-1.5 rounded-lg hover:bg-slate-100 text-slate-500 hover:text-slate-800 transition-colors cursor-pointer"
title="Opsi Lainnya"
>
<MoreVertical className="w-3.5 h-3.5" />
</button>
</div>
</td>
</tr>
);
})}
</tbody>
</table>
</div>
{/* 5. Pagination Bar */}
<div className="px-4 py-3 bg-slate-50/60 border-t border-slate-200/80 flex flex-col sm:flex-row items-center justify-between gap-3 text-xs text-slate-500">
<span className="font-semibold text-slate-600">
Menampilkan 1 - 10 dari 128 data
</span>
<div className="flex items-center gap-2">
<div className="flex items-center gap-1 font-bold">
<button className="w-7 h-7 rounded-lg border border-slate-200 bg-white hover:bg-slate-50 flex items-center justify-center text-slate-600 cursor-pointer">
<
</button>
<button className="w-7 h-7 rounded-lg bg-[#EC167F] text-white flex items-center justify-center font-black cursor-pointer shadow-2xs">
1
</button>
<button className="w-7 h-7 rounded-lg border border-slate-200 bg-white hover:bg-slate-50 flex items-center justify-center text-slate-600 cursor-pointer">
2
</button>
<button className="w-7 h-7 rounded-lg border border-slate-200 bg-white hover:bg-slate-50 flex items-center justify-center text-slate-600 cursor-pointer">
3
</button>
<span className="px-1 text-slate-400">...</span>
<button className="w-7 h-7 rounded-lg border border-slate-200 bg-white hover:bg-slate-50 flex items-center justify-center text-slate-600 cursor-pointer">
13
</button>
<button className="w-7 h-7 rounded-lg border border-slate-200 bg-white hover:bg-slate-50 flex items-center justify-center text-slate-600 cursor-pointer">
>
</button>
</div>
<div className="relative">
<select className="appearance-none pl-2.5 pr-6 py-1 bg-white border border-slate-200 rounded-lg text-xs font-bold text-slate-700 cursor-pointer focus:outline-none">
<option>10 / halaman</option>
<option>25 / halaman</option>
<option>50 / halaman</option>
</select>
<ChevronDown className="w-3 h-3 text-slate-400 absolute right-2 top-2 pointer-events-none" />
</div>
</div>
</div>
</div>
</div>
);
};