development #14
@@ -1,6 +1,6 @@
|
||||
import { Link, useLocation } from '@tanstack/react-router'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { NAV_ITEMS } from './nav-items'
|
||||
import { isNavItemActive, NAV_ITEMS } from './nav-items'
|
||||
|
||||
export function BottomNav() {
|
||||
const location = useLocation()
|
||||
@@ -9,21 +9,28 @@ export function BottomNav() {
|
||||
<nav className="fixed inset-x-0 bottom-0 z-40 border-t border-border bg-surface/95 pb-[env(safe-area-inset-bottom)] backdrop-blur lg:hidden">
|
||||
<div className="mx-auto grid max-w-md grid-cols-4">
|
||||
{NAV_ITEMS.map(({ label, to, icon: Icon }) => {
|
||||
const isActive = location.pathname === to
|
||||
const isActive = isNavItemActive(location.pathname, to)
|
||||
return (
|
||||
<Link
|
||||
key={to}
|
||||
to={to}
|
||||
aria-current={isActive ? 'page' : undefined}
|
||||
className={cn(
|
||||
'flex flex-col items-center gap-0.5 py-2.5 text-[11px] font-medium transition-colors',
|
||||
isActive ? 'text-accent-fg' : 'text-foreground/50 hover:text-primary',
|
||||
'flex min-h-14 flex-col items-center justify-center gap-1 py-2 text-[11px] font-medium transition-colors',
|
||||
isActive ? 'text-accent-fg' : 'text-foreground/80 hover:text-primary',
|
||||
)}
|
||||
>
|
||||
<Icon
|
||||
className={cn('size-6', isActive && 'fill-accent/15 stroke-accent')}
|
||||
strokeWidth={isActive ? 2.2 : 2}
|
||||
/>
|
||||
{label}
|
||||
{/* Pastilla suave detrás del ícono: el estado activo se lee por
|
||||
color + fondo, no solo por el tono del texto. */}
|
||||
<span
|
||||
className={cn(
|
||||
'flex size-8 items-center justify-center rounded-lg transition-colors duration-150',
|
||||
isActive && 'bg-accent-soft',
|
||||
)}
|
||||
>
|
||||
<Icon className="size-5" strokeWidth={isActive ? 2.25 : 2} />
|
||||
</span>
|
||||
<span className="leading-none">{label}</span>
|
||||
</Link>
|
||||
)
|
||||
})}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Link, useLocation } from '@tanstack/react-router'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { Logo } from '../brand'
|
||||
import { NAV_ITEMS } from './nav-items'
|
||||
import { isNavItemActive, NAV_ITEMS } from './nav-items'
|
||||
|
||||
export function Sidebar() {
|
||||
const location = useLocation()
|
||||
@@ -16,16 +16,17 @@ export function Sidebar() {
|
||||
|
||||
<nav className="flex flex-col gap-1">
|
||||
{NAV_ITEMS.map(({ label, to, icon: Icon }) => {
|
||||
const isActive = location.pathname === to
|
||||
const isActive = isNavItemActive(location.pathname, to)
|
||||
return (
|
||||
<Link
|
||||
key={to}
|
||||
to={to}
|
||||
aria-current={isActive ? 'page' : undefined}
|
||||
className={cn(
|
||||
'flex items-center gap-3 rounded-xl px-3 py-2.5 text-sm font-medium transition-colors',
|
||||
isActive
|
||||
? 'bg-accent-soft text-accent-fg'
|
||||
: 'text-foreground/60 hover:bg-primary-soft hover:text-primary',
|
||||
: 'text-foreground/80 hover:bg-primary-soft hover:text-primary',
|
||||
)}
|
||||
>
|
||||
<Icon className="size-5" strokeWidth={isActive ? 2.2 : 2} />
|
||||
|
||||
@@ -12,3 +12,12 @@ export const NAV_ITEMS: NavItem[] = [
|
||||
{ label: 'Cobros', to: '/payments', icon: Wallet },
|
||||
{ label: 'Ajustes', to: '/settings', icon: Settings },
|
||||
]
|
||||
|
||||
/** Una sección sigue activa dentro de sus subrutas: en `/groups/abc` el ítem
|
||||
* activo es "Grupos", no ninguno. El prefijo se corta en el separador para
|
||||
* que `/groupsomething` no se considere "/groups". La raíz es exacta: no hay
|
||||
* subrutas del home que deban marcarla. */
|
||||
export function isNavItemActive(pathname: string, to: string): boolean {
|
||||
if (to === '/') return pathname === '/'
|
||||
return pathname === to || pathname.startsWith(`${to}/`)
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export const Badge = forwardRef<HTMLSpanElement, BadgeProps>(
|
||||
<span
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium',
|
||||
'inline-flex shrink-0 items-center whitespace-nowrap rounded-full px-2.5 py-0.5 text-xs font-medium',
|
||||
variants[variant],
|
||||
className,
|
||||
)}
|
||||
|
||||
@@ -28,7 +28,10 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
ref={ref}
|
||||
type={type}
|
||||
className={cn(
|
||||
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:pointer-events-none disabled:opacity-50',
|
||||
// `transition-*` explícito en vez de `transition-all`: solo se animan
|
||||
// color, fondo, borde y transform. El feedback de presión se anula
|
||||
// con `motion-reduce` para respetar prefers-reduced-motion.
|
||||
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl font-medium transition-[color,background-color,border-color,fill,stroke,transform] duration-150 ease-out active:scale-[0.96] motion-reduce:active:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:pointer-events-none disabled:opacity-50',
|
||||
variants[variant],
|
||||
sizes[size],
|
||||
className,
|
||||
|
||||
@@ -43,7 +43,7 @@ export function GroupDetailView() {
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="animate-fade-in space-y-6">
|
||||
<section className="animate-fade-in space-y-5 sm:space-y-6">
|
||||
<GroupHeader />
|
||||
<GroupInfoCard />
|
||||
<MembersWaitlistSection />
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Link, useNavigate } from '@tanstack/react-router'
|
||||
import { ArrowLeft, BarChart3, Share2, UserPlus } from 'lucide-react'
|
||||
import { Badge, Button } from '../../../components/ui'
|
||||
import { cn } from '../../../lib/utils'
|
||||
import { RISK_LABELS } from '../constants'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
|
||||
@@ -13,38 +14,48 @@ export function GroupHeader() {
|
||||
<div>
|
||||
<Link
|
||||
to="/groups"
|
||||
className="mb-3 hidden items-center gap-1 text-sm text-foreground/60 transition-colors hover:text-primary lg:inline-flex"
|
||||
className="mb-3 hidden items-center gap-1 text-sm text-foreground/80 transition-colors hover:text-primary lg:inline-flex"
|
||||
>
|
||||
<ArrowLeft className="size-4" />
|
||||
<span>Volver a grupos</span>
|
||||
</Link>
|
||||
|
||||
<div className="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<div className="flex items-center gap-2.5">
|
||||
<h1 className="text-2xl font-bold text-primary">{group?.name}</h1>
|
||||
<Badge variant="success">Activo</Badge>
|
||||
{/* El título se queda con el ancho completo: los estados bajan a su propia
|
||||
fila compacta en vez de competir con el nombre por el espacio. */}
|
||||
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-6">
|
||||
<div className="min-w-0 sm:max-w-2xl">
|
||||
<h1 className="text-balance text-2xl font-bold leading-tight text-primary sm:text-[1.75rem]">
|
||||
{group?.name}
|
||||
</h1>
|
||||
{group?.description ? (
|
||||
<p className="mt-1.5 text-sm leading-relaxed text-foreground/80">{group.description}</p>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap items-center gap-2 sm:shrink-0 sm:justify-end">
|
||||
<Badge variant="success" className="gap-1.5 text-[11px]">
|
||||
<span className="size-1.5 rounded-full bg-success" aria-hidden="true" />
|
||||
Activo
|
||||
</Badge>
|
||||
{hasRisk ? (
|
||||
<Badge variant={riskLevel === 'HIGH' ? 'danger' : 'warning'} className="gap-1.5">
|
||||
<Badge
|
||||
variant={riskLevel === 'HIGH' ? 'danger' : 'warning'}
|
||||
className="gap-1.5 text-[11px]"
|
||||
>
|
||||
<span
|
||||
className={`size-2 rounded-full ${riskLevel === 'HIGH' ? 'bg-danger' : 'bg-warning'}`}
|
||||
className={cn('size-1.5 rounded-full', riskLevel === 'HIGH' ? 'bg-danger' : 'bg-warning')}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
{RISK_LABELS[riskLevel]}
|
||||
</Badge>
|
||||
) : null}
|
||||
</div>
|
||||
{group?.description ? (
|
||||
<p className="mt-1 text-sm text-foreground/70">{group.description}</p>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<div className="grid w-full grid-cols-2 gap-2 sm:flex sm:w-auto sm:flex-wrap sm:items-center sm:gap-2.5">
|
||||
<div className="mt-4 grid grid-cols-2 gap-2.5 sm:mt-5 sm:flex sm:flex-wrap sm:items-center sm:justify-end sm:gap-2.5">
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() =>
|
||||
void navigate({ to: '/groups/$groupId/analytics', params: { groupId } })
|
||||
}
|
||||
onClick={() => void navigate({ to: '/groups/$groupId/analytics', params: { groupId } })}
|
||||
className="w-full justify-center border-border sm:w-auto"
|
||||
>
|
||||
<BarChart3 className="size-4 text-accent" />
|
||||
@@ -74,6 +85,5 @@ export function GroupHeader() {
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -7,12 +7,14 @@ export function GroupInfoCard() {
|
||||
if (!group) return null
|
||||
|
||||
return (
|
||||
<div className="grid grid-cols-1 gap-4 rounded-xl border border-border bg-surface p-4 text-sm md:grid-cols-3">
|
||||
<div className="flex items-center gap-3">
|
||||
<CalendarClock className="size-5 shrink-0 text-accent" />
|
||||
<div>
|
||||
<p className="text-xs font-medium uppercase text-foreground/50">Horario</p>
|
||||
<p className="font-medium text-primary">
|
||||
<div className="grid grid-cols-1 gap-x-6 gap-y-4 rounded-2xl bg-primary-soft p-4 sm:p-5 md:grid-cols-3 md:gap-x-0 md:divide-x md:divide-border/70">
|
||||
<div className="flex items-start gap-3 md:pr-6">
|
||||
<CalendarClock className="mt-0.5 size-5 shrink-0 text-accent" />
|
||||
<div className="min-w-0">
|
||||
<p className="text-[11px] font-semibold uppercase tracking-wide text-foreground/80">
|
||||
Horario
|
||||
</p>
|
||||
<p className="mt-0.5 text-sm font-semibold text-primary">
|
||||
{(group.days?.length ?? 0) > 0
|
||||
? formatSchedule(group.days ?? [], group.time)
|
||||
: 'Sin horario definido'}
|
||||
@@ -20,22 +22,26 @@ export function GroupInfoCard() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-3">
|
||||
<Users className="size-5 shrink-0 text-accent" />
|
||||
<div>
|
||||
<p className="text-xs font-medium uppercase text-foreground/50">Miembros & Cupo</p>
|
||||
<p className="font-medium text-primary">
|
||||
<div className="flex items-start gap-3 md:px-6">
|
||||
<Users className="mt-0.5 size-5 shrink-0 text-accent" />
|
||||
<div className="min-w-0">
|
||||
<p className="text-[11px] font-semibold uppercase tracking-wide text-foreground/80">
|
||||
Miembros & Cupo
|
||||
</p>
|
||||
<p className="mt-0.5 text-sm font-semibold tabular-nums text-primary">
|
||||
{attendees.length} inscritos {waitlistTotal > 0 ? ` · ${waitlistTotal} en espera` : ''}
|
||||
{group.capacity ? ` · Cupo de ${group.capacity}` : ''}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="flex size-5 shrink-0 items-center justify-center font-bold text-accent">$</div>
|
||||
<div>
|
||||
<p className="text-xs font-medium uppercase text-foreground/50">Cobro</p>
|
||||
<p className="font-medium text-primary">
|
||||
<div className="flex items-start gap-3 md:pl-6">
|
||||
<div className="mt-0.5 flex size-5 shrink-0 items-center justify-center text-sm font-bold leading-none text-accent">
|
||||
$
|
||||
</div>
|
||||
<div className="min-w-0">
|
||||
<p className="text-[11px] font-semibold uppercase tracking-wide text-foreground/80">Cobro</p>
|
||||
<p className="mt-0.5 text-sm font-semibold tabular-nums text-primary">
|
||||
{group.price != null ? formatPrice(group.price) : 'Sin precio'}
|
||||
{group.billingType ? ` · ${BILLING_LABELS[group.billingType]}` : ''}
|
||||
{group.dueDay ? ` · Vence día ${group.dueDay}` : ''}
|
||||
|
||||
@@ -12,40 +12,50 @@ export function MembersTable({ attendees }: { attendees: AttendeeDto[] }) {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full text-left text-sm">
|
||||
<thead className="border-b border-border text-xs font-semibold uppercase text-foreground/60">
|
||||
<tr>
|
||||
<th className="px-3 pb-3">Nombre</th>
|
||||
<th className="px-3 pb-3">Teléfono</th>
|
||||
<th className="w-8 px-3 pb-3" />
|
||||
<table className="w-full table-fixed text-left text-sm">
|
||||
<thead>
|
||||
<tr className="border-b border-border/70 text-xs font-semibold text-foreground/80">
|
||||
<th scope="col" className="w-[54%] px-3 pb-2">Nombre</th>
|
||||
<th scope="col" className="px-3 pb-2">Teléfono</th>
|
||||
<th scope="col" className="w-9 px-1 pb-2">
|
||||
<span className="sr-only">Detalle</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-border">
|
||||
<tbody>
|
||||
{attendees.map((attendee) => (
|
||||
<tr
|
||||
key={attendee.id}
|
||||
className="cursor-pointer transition-colors hover:bg-primary-soft/50"
|
||||
className="group cursor-pointer border-b border-border/70 transition-colors last:border-b-0 hover:bg-primary-soft/60"
|
||||
onClick={() => openAttendee(attendee.id)}
|
||||
>
|
||||
<td className="px-3 py-3">
|
||||
<div className="flex items-center gap-2.5">
|
||||
<div className="flex size-8 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent">
|
||||
<td className="px-3 py-2.5">
|
||||
<div className="flex min-w-0 items-center gap-2.5">
|
||||
<div className="flex size-9 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent">
|
||||
{attendee.fullName.charAt(0).toUpperCase()}
|
||||
</div>
|
||||
<span className="font-medium text-primary">{attendee.fullName}</span>
|
||||
{/* `truncate` solo recorta lo pintado: el texto completo sigue en
|
||||
el DOM para lectores de pantalla, y `title` lo muestra al hover. */}
|
||||
<span className="min-w-0 truncate font-medium text-primary" title={attendee.fullName}>
|
||||
{attendee.fullName}
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-3 py-3 text-foreground/70">
|
||||
{attendee.phone || <span className="text-foreground/40">—</span>}
|
||||
<td className="min-w-0 px-3 py-2.5 text-foreground/80">
|
||||
{attendee.phone ? (
|
||||
<span className="block truncate tabular-nums" title={attendee.phone}>
|
||||
{attendee.phone}
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-foreground/60">—</span>
|
||||
)}
|
||||
</td>
|
||||
<td className="px-1 py-3 text-foreground/30">
|
||||
<ChevronRight className="size-4" />
|
||||
<td className="w-9 px-1 py-2.5 text-foreground/50">
|
||||
<ChevronRight className="ml-auto size-4 transition-colors group-hover:text-accent" />
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -8,18 +8,9 @@ import { WaitlistTable } from './WaitlistTable'
|
||||
|
||||
export function MembersWaitlistSection() {
|
||||
const {
|
||||
groupId,
|
||||
attendees,
|
||||
attendeesTotal,
|
||||
attendeesPending,
|
||||
waitlistEntries,
|
||||
waitlistTotal,
|
||||
waitlistPending,
|
||||
listSection,
|
||||
setListSection,
|
||||
searchFilter,
|
||||
setSearchFilter,
|
||||
openInviteModal,
|
||||
groupId, attendees, attendeesTotal, attendeesPending,
|
||||
waitlistEntries, waitlistTotal, waitlistPending,
|
||||
listSection, setListSection, searchFilter, setSearchFilter, openInviteModal,
|
||||
} = useGroupDetail()
|
||||
const navigate = useNavigate()
|
||||
|
||||
@@ -32,31 +23,44 @@ export function MembersWaitlistSection() {
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="space-y-4 rounded-xl border border-border bg-surface p-5">
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex flex-col justify-between gap-3 sm:flex-row sm:items-center">
|
||||
<div className="flex w-full items-center rounded-xl bg-primary-soft p-1 sm:w-[26rem]">
|
||||
// Radios concéntricos: `rounded-2xl` (16px) con `p-2` (8px) deja a las
|
||||
// superficies interiores un radio de 16 - 8 = 8px, o sea `rounded-lg`.
|
||||
// Sin bordes: el lavado `bg-primary-soft` separa la sección del fondo.
|
||||
<div className="rounded-2xl bg-primary-soft p-2">
|
||||
<div className="space-y-2 p-2 sm:p-3">
|
||||
<div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-3">
|
||||
<div
|
||||
role="tablist"
|
||||
aria-label="Listado del grupo"
|
||||
className="flex w-full items-center gap-1 rounded-lg bg-surface p-0.5 shadow-xs sm:w-[26rem]"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={listSection === 'members'}
|
||||
onClick={() => setListSection('members')}
|
||||
className={cn(
|
||||
'flex flex-1 items-center justify-center gap-1.5 rounded-lg py-2 text-xs font-semibold transition-all',
|
||||
'flex min-h-10 flex-1 items-center justify-center gap-1.5 rounded-md px-2 text-xs font-semibold transition-[color,background-color,box-shadow] duration-150',
|
||||
listSection === 'members'
|
||||
? 'bg-surface text-primary shadow-xs'
|
||||
: 'text-foreground/60 hover:text-primary',
|
||||
? 'bg-accent text-on-accent shadow-xs'
|
||||
: 'text-foreground/80 hover:bg-primary-soft hover:text-primary',
|
||||
)}
|
||||
>
|
||||
<Users className="size-4 shrink-0" />
|
||||
<span className="whitespace-nowrap">Miembros ({attendeesTotal})</span>
|
||||
<span className="whitespace-nowrap">
|
||||
Miembros ({attendeesTotal})
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={listSection === 'waitlist'}
|
||||
onClick={() => setListSection('waitlist')}
|
||||
className={cn(
|
||||
'flex flex-1 items-center justify-center gap-1.5 rounded-lg py-2 text-xs font-semibold transition-all',
|
||||
'flex min-h-10 flex-1 items-center justify-center gap-1.5 rounded-md px-2 text-xs font-semibold transition-[color,background-color,box-shadow] duration-150',
|
||||
listSection === 'waitlist'
|
||||
? 'bg-surface text-primary shadow-xs'
|
||||
: 'text-foreground/60 hover:text-primary',
|
||||
? 'bg-accent text-on-accent shadow-xs'
|
||||
: 'text-foreground/80 hover:bg-primary-soft hover:text-primary',
|
||||
)}
|
||||
>
|
||||
<Clock className="size-4 shrink-0" />
|
||||
@@ -66,24 +70,26 @@ export function MembersWaitlistSection() {
|
||||
|
||||
{listSection === 'members' ? (
|
||||
<div className="relative w-full sm:w-64">
|
||||
<Search className="absolute left-3 top-2.5 size-4 text-foreground/40" />
|
||||
<Search className="pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-foreground/70" />
|
||||
<Input
|
||||
placeholder="Buscar por nombre o teléfono..."
|
||||
value={searchFilter}
|
||||
onChange={(e) => setSearchFilter(e.target.value)}
|
||||
className="h-9 pl-9 text-xs"
|
||||
aria-label="Buscar miembros"
|
||||
className="h-10 rounded-lg border-transparent pl-9 shadow-xs placeholder:text-foreground/80"
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<p className="text-xs text-foreground/60">
|
||||
<p className="text-xs leading-relaxed text-foreground/80">
|
||||
{listSection === 'members'
|
||||
? 'Listado de todos los miembros incorporados al grupo.'
|
||||
: 'Personas que esperan un cupo libre en el grupo. Al pasar a alguien al grupo, se crea automáticamente su registro como miembro.'}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="rounded-lg bg-surface p-1 shadow-xs sm:p-2">
|
||||
{listSection === 'members' ? (
|
||||
<>
|
||||
{attendeesPending ? (
|
||||
@@ -93,26 +99,22 @@ export function MembersWaitlistSection() {
|
||||
) : null}
|
||||
|
||||
{!attendeesPending && attendees.length === 0 ? (
|
||||
<div className="rounded-xl border border-dashed border-border px-4 py-12 text-center">
|
||||
<Users className="mx-auto mb-2 size-10 text-foreground/30" />
|
||||
<p className="font-medium text-primary">Todavía no hay miembros en este grupo</p>
|
||||
<p className="mx-auto mt-1 max-w-sm text-sm text-foreground/60">
|
||||
<div className="rounded-lg bg-primary-soft/50 px-4 py-10 text-center">
|
||||
<Users className="mx-auto mb-2 size-10 text-foreground/40" />
|
||||
<p className="text-sm font-semibold text-primary">
|
||||
Todavía no hay miembros en este grupo
|
||||
</p>
|
||||
<p className="mx-auto mt-1 max-w-sm text-sm text-foreground/80">
|
||||
Puedes compartir el enlace de invitación único o agregar miembros de forma manual o
|
||||
masiva.
|
||||
</p>
|
||||
<div className="mt-4 flex flex-col gap-2.5 sm:flex-row sm:items-center sm:justify-center sm:gap-3">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={openInviteModal}
|
||||
className="w-full sm:w-auto"
|
||||
>
|
||||
<Button variant="outline" onClick={openInviteModal} className="w-full sm:w-auto">
|
||||
<Share2 className="size-4" />
|
||||
Compartir Enlace
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
size="sm"
|
||||
onClick={() =>
|
||||
void navigate({ to: '/groups/$groupId/attendees/new', params: { groupId } })
|
||||
}
|
||||
@@ -126,7 +128,7 @@ export function MembersWaitlistSection() {
|
||||
) : null}
|
||||
|
||||
{attendees.length > 0 && filteredAttendees.length === 0 ? (
|
||||
<div className="py-8 text-center text-sm text-foreground/60">
|
||||
<div className="py-8 text-center text-sm text-foreground/80">
|
||||
No se encontraron miembros que coincidan con la búsqueda.
|
||||
</div>
|
||||
) : null}
|
||||
@@ -142,10 +144,10 @@ export function MembersWaitlistSection() {
|
||||
) : null}
|
||||
|
||||
{!waitlistPending && waitlistEntries.length === 0 ? (
|
||||
<div className="rounded-xl border border-dashed border-border px-4 py-12 text-center">
|
||||
<Clock className="mx-auto mb-2 size-10 text-foreground/30" />
|
||||
<p className="font-medium text-primary">No hay nadie en la lista de espera</p>
|
||||
<p className="mx-auto mt-1 max-w-sm text-sm text-foreground/60">
|
||||
<div className="rounded-lg bg-primary-soft/50 px-4 py-10 text-center">
|
||||
<Clock className="mx-auto mb-2 size-10 text-foreground/40" />
|
||||
<p className="text-sm font-semibold text-primary">No hay nadie en la lista de espera</p>
|
||||
<p className="mx-auto mt-1 max-w-sm text-sm text-foreground/80">
|
||||
Cuando el grupo alcance su cupo, las personas podrán sumarse a la espera y podrás
|
||||
pasarlas al grupo desde aquí.
|
||||
</p>
|
||||
@@ -156,5 +158,6 @@ export function MembersWaitlistSection() {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -6,43 +6,55 @@ export function WaitlistTable({ entries }: { entries: GroupWaitlistEntryDto[] })
|
||||
const { setSelectedWaitlistEntry } = useGroupDetail()
|
||||
|
||||
return (
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full text-left text-sm">
|
||||
<thead className="border-b border-border text-xs font-semibold uppercase text-foreground/60">
|
||||
<tr>
|
||||
<th className="px-3 pb-3">Nombre</th>
|
||||
<th className="px-3 pb-3">Teléfono</th>
|
||||
<th className="w-8 px-3 pb-3" />
|
||||
<table className="w-full table-fixed text-left text-sm">
|
||||
<thead>
|
||||
<tr className="border-b border-border/70 text-xs font-semibold text-foreground/80">
|
||||
<th scope="col" className="w-[54%] px-3 pb-2">Nombre</th>
|
||||
<th scope="col" className="px-3 pb-2">Teléfono</th>
|
||||
<th scope="col" className="w-9 px-1 pb-2">
|
||||
<span className="sr-only">Detalle</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-border">
|
||||
<tbody>
|
||||
{entries.map((entry) => (
|
||||
<tr
|
||||
key={entry.id}
|
||||
className="cursor-pointer transition-colors hover:bg-primary-soft/50"
|
||||
className="group cursor-pointer border-b border-border/70 transition-colors last:border-b-0 hover:bg-primary-soft/60"
|
||||
onClick={() => setSelectedWaitlistEntry(entry)}
|
||||
>
|
||||
<td className="px-3 py-3">
|
||||
<div className="flex items-center gap-2.5">
|
||||
<div className="flex size-8 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent">
|
||||
<td className="px-3 py-2.5">
|
||||
<div className="flex min-w-0 items-center gap-2.5">
|
||||
<div className="flex size-9 shrink-0 items-center justify-center rounded-full bg-accent/10 text-xs font-semibold text-accent">
|
||||
{entry.fullName.charAt(0).toUpperCase()}
|
||||
</div>
|
||||
<div className="min-w-0">
|
||||
<p className="truncate font-medium text-primary">{entry.fullName}</p>
|
||||
<p className="truncate font-medium text-primary" title={entry.fullName}>
|
||||
{entry.fullName}
|
||||
</p>
|
||||
{entry.notes ? (
|
||||
<p className="truncate text-xs text-foreground/50">{entry.notes}</p>
|
||||
<p className="truncate text-xs text-foreground/70" title={entry.notes}>
|
||||
{entry.notes}
|
||||
</p>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-3 py-3 text-foreground/70">{entry.phone}</td>
|
||||
<td className="px-1 py-3 text-foreground/30">
|
||||
<ChevronRight className="size-4" />
|
||||
<td className="min-w-0 px-3 py-2.5 text-foreground/80">
|
||||
{entry.phone ? (
|
||||
<span className="block truncate tabular-nums" title={entry.phone}>
|
||||
{entry.phone}
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-foreground/60">—</span>
|
||||
)}
|
||||
</td>
|
||||
<td className="w-9 px-1 py-2.5 text-foreground/50">
|
||||
<ChevronRight className="ml-auto size-4 transition-colors group-hover:text-accent" />
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user