"use client"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; interface Client { id: string; firstName: string; lastName: string; email: string | null; phone: string | null; avatar?: string | null; level: string | null; isActive: boolean; createdAt: string; memberships?: Array<{ id: string; status: string; remainingHours: number | null; endDate: string; plan: { id: string; name: string; discountPercent: number | string | null; }; }>; _count?: { bookings: number; }; } interface ClientTableProps { clients: Client[]; onRowClick?: (client: Client) => void; onEdit?: (client: Client) => void; onDelete?: (client: Client) => void; isLoading?: boolean; currentPage: number; totalPages: number; onPageChange: (page: number) => void; } // Loading skeleton for table rows function TableSkeleton() { return ( <> {[...Array(5)].map((_, i) => (
| Cliente | Telefono | Membresia | Reservas | Acciones |
|---|
No hay clientes
Agrega tu primer cliente para comenzar
| Cliente | Telefono | Membresia | Reservas | Acciones | |
|---|---|---|---|---|---|
|
{client.avatar ? (
{getInitials(client.firstName, client.lastName)}
)}
{client.firstName} {client.lastName} {client.level && (Nivel: {client.level} )} |
{/* Email */}
{client.email || ( - )} | {/* Phone */}{client.phone || ( - )} | {/* Membership Status */}{membershipBadge.label} | {/* Bookings Count */}{client._count?.bookings || 0} | {/* Actions */}
e.stopPropagation()}
>
|