import React, { useState } from 'react'; import { Calendar as CalendarIcon, Clock, MapPin, User, ChevronLeft, ChevronRight, Plus, Filter, Search } from 'lucide-react'; interface Event { id: string; title: string; date: string; time: string; location: string; client: string; status: 'confirmed' | 'pending' | 'completed'; type: 'formatura' | 'casamento' | 'evento'; } const MOCK_EVENTS: Event[] = [ { id: '1', title: 'Formatura Medicina UFPR', date: '2025-12-15', time: '19:00', location: 'Teatro Guaíra, Curitiba', client: 'Ana Paula Silva', status: 'confirmed', type: 'formatura' }, { id: '2', title: 'Casamento Maria & João', date: '2025-12-20', time: '16:00', location: 'Fazenda Vista Alegre', client: 'Maria Santos', status: 'confirmed', type: 'casamento' }, { id: '3', title: 'Formatura Direito PUC', date: '2025-12-22', time: '20:00', location: 'Centro de Convenções', client: 'Carlos Eduardo', status: 'pending', type: 'formatura' }, { id: '4', title: 'Formatura Engenharia UTFPR', date: '2025-12-28', time: '18:30', location: 'Espaço Nobre Eventos', client: 'Roberto Mendes', status: 'confirmed', type: 'formatura' }, { id: '5', title: 'Evento Corporativo Tech Summit', date: '2026-01-10', time: '09:00', location: 'Hotel Bourbon', client: 'TechCorp Ltda', status: 'pending', type: 'evento' }, { id: '6', title: 'Formatura Odontologia', date: '2026-01-15', time: '19:30', location: 'Clube Curitibano', client: 'Juliana Costa', status: 'confirmed', type: 'formatura' } ]; export const CalendarPage: React.FC = () => { const [selectedMonth, setSelectedMonth] = useState(new Date()); const [selectedEvent, setSelectedEvent] = useState(null); const [viewMode, setViewMode] = useState<'month' | 'week'>('month'); const getStatusColor = (status: Event['status']) => { switch (status) { case 'confirmed': return 'bg-green-100 text-green-700 border-green-200'; case 'pending': return 'bg-yellow-100 text-yellow-700 border-yellow-200'; case 'completed': return 'bg-gray-100 text-gray-700 border-gray-200'; } }; const getStatusLabel = (status: Event['status']) => { switch (status) { case 'confirmed': return 'Confirmado'; case 'pending': return 'Pendente'; case 'completed': return 'Concluído'; } }; const getTypeColor = (type: Event['type']) => { switch (type) { case 'formatura': return 'bg-[#492E61] text-white'; case 'casamento': return 'bg-pink-500 text-white'; case 'evento': return 'bg-blue-500 text-white'; } }; const nextMonth = () => { setSelectedMonth(new Date(selectedMonth.getFullYear(), selectedMonth.getMonth() + 1)); }; const prevMonth = () => { setSelectedMonth(new Date(selectedMonth.getFullYear(), selectedMonth.getMonth() - 1)); }; const generateCalendarDays = () => { const year = selectedMonth.getFullYear(); const month = selectedMonth.getMonth(); const firstDay = new Date(year, month, 1); const lastDay = new Date(year, month + 1, 0); const daysInMonth = lastDay.getDate(); const startingDayOfWeek = firstDay.getDay(); const days: (Date | null)[] = []; // Add empty cells for days before the first day of the month for (let i = 0; i < startingDayOfWeek; i++) { days.push(null); } // Add all days of the month for (let day = 1; day <= daysInMonth; day++) { days.push(new Date(year, month, day)); } return days; }; const getEventsForDate = (date: Date) => { return MOCK_EVENTS.filter(event => { const eventDate = new Date(event.date + 'T00:00:00'); return eventDate.toDateString() === date.toDateString(); }); }; const isToday = (date: Date) => { const today = new Date(); return date.toDateString() === today.toDateString(); }; const currentMonthName = selectedMonth.toLocaleDateString('pt-BR', { month: 'long', year: 'numeric' }); const calendarDays = generateCalendarDays(); const monthEvents = MOCK_EVENTS.filter(event => { const eventDate = new Date(event.date + 'T00:00:00'); return eventDate.getMonth() === selectedMonth.getMonth() && eventDate.getFullYear() === selectedMonth.getFullYear(); }); return (
{/* Header */}

Minha Agenda

Gerencie seus eventos e compromissos fotográficos

{/* Calendar Card */}
{/* Header */}

{currentMonthName}

{/* Calendar Grid */}
{/* Week Days */}
{['D', 'S', 'T', 'Q', 'Q', 'S', 'S'].map((day, idx) => (
{day}
))}
{/* Days */}
{calendarDays.map((day, index) => { if (!day) { return
; } const dayEvents = getEventsForDate(day); const today = isToday(day); return (
0 ? 'border-brand-black/20 bg-brand-black text-white hover:border-brand-gold' : 'border-gray-200 text-gray-700 hover:border-gray-300 hover:bg-gray-50' }`} > {day.getDate()} {dayEvents.length > 0 && !today && (
{dayEvents.slice(0, 3).map((_, i) => (
))}
)}
); })}
{/* Stats Footer */}

Total

{monthEvents.length}

Confirmados

{monthEvents.filter(e => e.status === 'confirmed').length}

Pendentes

{monthEvents.filter(e => e.status === 'pending').length}

{/* Search Bar */}
{/* Events List - Table Format */}
{monthEvents.map((event) => ( ))}
Evento Data Horário Local Cliente Status
{event.title}
{new Date(event.date + 'T00:00:00').toLocaleDateString('pt-BR')}
{event.time}
{event.location}
{event.client}
{getStatusLabel(event.status)}
{monthEvents.length === 0 && (

Nenhum evento encontrado neste mês.

)}
); };