import React, { useState } from 'react' import { motion, AnimatePresence } from 'framer-motion' import { HiKey, HiCalendar, HiTruck, HiCog, HiPlus, HiXMark } from 'react-icons/hi2' import dayjs from 'dayjs' import { mockReservations, Reservation } from '../../../mocks/mockIntranetData' const ReservationsModule: React.FC = () => { const [selectedType, setSelectedType] = useState<'all' | 'room' | 'vehicle' | 'equipment'>('all') const [showNewReservation, setShowNewReservation] = useState(false) const filteredReservations = selectedType === 'all' ? mockReservations : mockReservations.filter((r) => r.type === selectedType) const getTypeIcon = (type: string) => { switch (type) { case 'room': return case 'vehicle': return case 'equipment': return default: return } } const getTypeLabel = (type: string) => { const labels: Record = { room: 'Toplantı Salonu', vehicle: 'Araç', equipment: 'Ekipman', } return labels[type] || type } const getStatusColor = (status: string) => { const colors: Record = { pending: 'bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300', approved: 'bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300', rejected: 'bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300', completed: 'bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300', } return colors[status] || colors.pending } const getStatusLabel = (status: string) => { const labels: Record = { pending: 'Bekliyor', approved: 'Onaylandı', rejected: 'Reddedildi', completed: 'Tamamlandı', } return labels[status] || status } return (
{/* Header */}

🔑 Rezervasyonlar

Oda, araç ve ekipman rezervasyonları

{/* Type Filter */}
{[ { value: 'all' as const, label: 'Tümü', icon: HiCalendar }, { value: 'room' as const, label: 'Toplantı Salonu', icon: HiKey }, { value: 'vehicle' as const, label: 'Araç', icon: HiTruck }, { value: 'equipment' as const, label: 'Ekipman', icon: HiCog }, ].map((type) => ( ))}
{/* Reservations List */}
{filteredReservations.map((reservation: Reservation, idx: number) => (
{getTypeIcon(reservation.type)}

{reservation.resourceName}

{getTypeLabel(reservation.type)}

{getStatusLabel(reservation.status)}

Başlangıç

{dayjs(reservation.startDate).format('DD MMM, HH:mm')}

Bitiş

{dayjs(reservation.endDate).format('DD MMM, HH:mm')}

Rezerve Eden

{reservation.bookedBy.fullName}

{reservation.bookedBy.fullName}

{reservation.participants && (

Katılımcı

{reservation.participants} kişi

)}

Amaç: {reservation.purpose}

{reservation.notes && (

Not: {reservation.notes}

)}
))} {filteredReservations.length === 0 && (

Rezervasyon bulunamadı

)}
{/* New Reservation Modal */} {showNewReservation && ( <> setShowNewReservation(false)} />

Yeni Rezervasyon Oluştur