import { dateLocaleCode } from '@/lib/dateFnsI18n';
import { useMemo } from 'react';
import { Link } from 'react-router-dom';
import { Calendar, Users, Pencil, Megaphone, Plus, CalendarClock } from 'lucide-react';
import { Card, CardContent } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
import { Skeleton } from '@/components/ui/skeleton';
import { useCurrentUser } from '@/hooks/useCurrentUser';
import { useSkateEvents } from '@/hooks/useSkateEvents';
import { useEventRsvps, eventCoord } from '@/hooks/useEventRsvps';
import { cn } from '@/lib/utils';
import type { SkateEvent } from '@/lib/types';
function formatWhen(ts: number): string {
return new Date(ts * 1000).toLocaleDateString(dateLocaleCode(), {
weekday: 'short',
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: '2-digit',
});
}
/** A single hosted-event row with live RSVP counts + quick actions. */
function HostedEventRow({ event, isPast }: { event: SkateEvent; isPast: boolean }) {
const { goingCount, tentativeCount } = useEventRsvps(eventCoord(event));
const to = `/event/${event.pubkey}/${event.identifier}`;
return (
Log in to see the events you're hosting.
{event.title}
Run a jam, comp or session. Create an event and skaters can RSVP, get updates, and roll through.