diff --git a/ui/src/components/intranet/Events/index.tsx b/ui/src/components/intranet/Events/index.tsx index ea796c07..a341e27a 100644 --- a/ui/src/components/intranet/Events/index.tsx +++ b/ui/src/components/intranet/Events/index.tsx @@ -8,12 +8,13 @@ import { HiCalendar, HiXMark, HiChevronLeft, - HiChevronRight + HiChevronRight, } from 'react-icons/hi2' import dayjs from 'dayjs' import 'dayjs/locale/tr' import relativeTime from 'dayjs/plugin/relativeTime' import { mockEvents, CalendarEvent, EventComment } from '../../../mocks/mockIntranetData' +import { mockEmployees } from '@/mocks/mockEmployees' dayjs.locale('tr') dayjs.extend(relativeTime) @@ -22,20 +23,21 @@ const EventsModule: React.FC = () => { const [selectedEvent, setSelectedEvent] = useState(null) const [selectedPhotoIndex, setSelectedPhotoIndex] = useState(0) const [showPhotoModal, setShowPhotoModal] = useState(false) - const [selectedFilter, setSelectedFilter] = useState<'all' | 'social' | 'training' | 'company' | 'sport' | 'culture'>('all') + const [selectedFilter, setSelectedFilter] = useState< + 'all' | 'social' | 'training' | 'company' | 'sport' | 'culture' + >('all') const [newComment, setNewComment] = useState('') const [events, setEvents] = useState(mockEvents) - const filteredEvents = selectedFilter === 'all' - ? events.filter(e => e.isPublished) - : events.filter(e => e.isPublished && e.type === selectedFilter) + const filteredEvents = + selectedFilter === 'all' + ? events.filter((e) => e.isPublished) + : events.filter((e) => e.isPublished && e.type === selectedFilter) const handleLikeEvent = (eventId: string) => { - setEvents(prev => prev.map(e => - e.id === eventId ? { ...e, likes: e.likes + 1 } : e - )) + setEvents((prev) => prev.map((e) => (e.id === eventId ? { ...e, likes: e.likes + 1 } : e))) if (selectedEvent?.id === eventId) { - setSelectedEvent(prev => prev ? { ...prev, likes: prev.likes + 1 } : null) + setSelectedEvent((prev) => (prev ? { ...prev, likes: prev.likes + 1 } : null)) } } @@ -44,22 +46,18 @@ const EventsModule: React.FC = () => { const comment: EventComment = { id: `c${Date.now()}`, - author: { - id: 'current-user', - fullName: 'Sedat Öztürk', - avatar: 'https://ui-avatars.com/api/?name=Sedat+Ozturk&background=3b82f6&color=fff' - }, + author: mockEmployees[0], content: newComment, createdAt: new Date(), - likes: 0 + likes: 0, } - setEvents(prev => prev.map(e => - e.id === eventId ? { ...e, comments: [...e.comments, comment] } : e - )) + setEvents((prev) => + prev.map((e) => (e.id === eventId ? { ...e, comments: [...e.comments, comment] } : e)), + ) if (selectedEvent?.id === eventId) { - setSelectedEvent(prev => prev ? { ...prev, comments: [...prev.comments, comment] } : null) + setSelectedEvent((prev) => (prev ? { ...prev, comments: [...prev.comments, comment] } : null)) } setNewComment('') @@ -71,7 +69,7 @@ const EventsModule: React.FC = () => { training: 'bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300', company: 'bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300', sport: 'bg-orange-100 dark:bg-orange-900/30 text-orange-700 dark:text-orange-300', - culture: 'bg-pink-100 dark:bg-pink-900/30 text-pink-700 dark:text-pink-300' + culture: 'bg-pink-100 dark:bg-pink-900/30 text-pink-700 dark:text-pink-300', } return colors[type] || colors.social } @@ -82,7 +80,7 @@ const EventsModule: React.FC = () => { training: '📚 Eğitim', company: '🏢 Kurumsal', sport: '⚽ Spor', - culture: '🎨 Kültür' + culture: '🎨 Kültür', } return labels[type] || type } @@ -92,9 +90,7 @@ const EventsModule: React.FC = () => {
{/* Header */}
-

- 🎊 Etkinlikler -

+

🎊 Etkinlikler

Şirket etkinlikleri, fotoğraflar ve anılar

@@ -108,7 +104,7 @@ const EventsModule: React.FC = () => { { value: 'training' as const, label: '📚 Eğitim' }, { value: 'company' as const, label: '🏢 Kurumsal' }, { value: 'sport' as const, label: '⚽ Spor' }, - { value: 'culture' as const, label: '🎨 Kültür' } + { value: 'culture' as const, label: '🎨 Kültür' }, ].map((tab) => (
)} +
- {/* Event Detail Modal */} - - {selectedEvent && ( - <> + {/* Event Detail Modal */} + + {selectedEvent && ( + <> + setSelectedEvent(null)} + /> +
setSelectedEvent(null)} - /> -
- e.stopPropagation()} - > - {/* Header */} -
-
-
-
- - {getTypeLabel(selectedEvent.type)} - - - {dayjs(selectedEvent.date).format('DD MMMM YYYY')} - -
-

- {selectedEvent.title} -

-

- {selectedEvent.description} -

+ initial={{ opacity: 0, scale: 0.95, y: 20 }} + animate={{ opacity: 1, scale: 1, y: 0 }} + exit={{ opacity: 0, scale: 0.95, y: 20 }} + className="bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-4xl w-full max-h-[90vh] overflow-y-auto my-8" + onClick={(e) => e.stopPropagation()} + > + {/* Header */} +
+
+
+
+ + {getTypeLabel(selectedEvent.type)} + + + {dayjs(selectedEvent.date).format('DD MMMM YYYY')} +
-
+ +
+ +
+
+ + {selectedEvent.location} +
+
+ + {selectedEvent.participants} katılımcı +
+
+ {selectedEvent.organizer.fullName} + Düzenleyen: {selectedEvent.organizer.fullName} +
+
+
+ + {/* Photo Gallery */} +
+

+ 📸 Fotoğraflar ({selectedEvent.photos.length}) +

+
+ {selectedEvent.photos.map((photo, idx) => ( + { + setSelectedPhotoIndex(idx) + setShowPhotoModal(true) + }} > - + {`${selectedEvent.title} + + ))} +
+
+ + {/* Comments Section */} +
+
+

+ 💬 Yorumlar ({selectedEvent.comments.length}) +

+
+
+
-
-
- - {selectedEvent.location} -
-
- - {selectedEvent.participants} katılımcı -
-
+ {/* Comments List */} +
+ {selectedEvent.comments.map((comment) => ( +
{selectedEvent.organizer.fullName} - Düzenleyen: {selectedEvent.organizer.fullName} -
-
-
- - {/* Photo Gallery */} -
-

- 📸 Fotoğraflar ({selectedEvent.photos.length}) -

-
- {selectedEvent.photos.map((photo, idx) => ( - { - setSelectedPhotoIndex(idx) - setShowPhotoModal(true) - }} - > - {`${selectedEvent.title} - - ))} -
-
- - {/* Comments Section */} -
-
-

- 💬 Yorumlar ({selectedEvent.comments.length}) -

-
- -
-
- - {/* Comments List */} -
- {selectedEvent.comments.map((comment) => ( -
- {comment.author.fullName} -
-
- - {comment.author.fullName} - - - {dayjs(comment.createdAt).fromNow()} - -
-

- {comment.content} -

-
- -
+
+
+ + {comment.author.fullName} + + + {dayjs(comment.createdAt).fromNow()} + +
+

+ {comment.content} +

+
+
- ))} -
- - {/* Add Comment */} -
- You -
- setNewComment(e.target.value)} - onKeyPress={(e) => { - if (e.key === 'Enter') { - handleAddComment(selectedEvent.id) - } - }} - placeholder="Yorumunuzu yazın..." - className="flex-1 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500" - /> -
+ ))} +
+ + {/* Add Comment */} +
+ You +
+ setNewComment(e.target.value)} + onKeyPress={(e) => { + if (e.key === 'Enter') { + handleAddComment(selectedEvent.id) + } + }} + placeholder="Yorumunuzu yazın..." + className="flex-1 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500" + /> +
- -
- - )} - +
+ +
+ + )} + - {/* Photo Viewer Modal */} - - {showPhotoModal && selectedEvent && ( - <> + {/* Photo Viewer Modal */} + + {showPhotoModal && selectedEvent && ( + <> + setShowPhotoModal(false)} + /> +
setShowPhotoModal(false)} - /> -
- e.stopPropagation()} + initial={{ opacity: 0, scale: 0.9 }} + animate={{ opacity: 1, scale: 1 }} + exit={{ opacity: 0, scale: 0.9 }} + className="relative max-w-5xl w-full" + onClick={(e) => e.stopPropagation()} + > + {/* Close Button */} + + + - {/* Navigation */} - {selectedEvent.photos.length > 1 && ( - <> - - - - )} + {/* Navigation */} + {selectedEvent.photos.length > 1 && ( + <> + + + + )} - {/* Image */} - {`${selectedEvent.title} + {/* Image */} + {`${selectedEvent.title} - {/* Counter */} -
- {selectedPhotoIndex + 1} / {selectedEvent.photos.length} -
-
-
- - )} - -
+ {/* Counter */} +
+ {selectedPhotoIndex + 1} / {selectedEvent.photos.length} +
+
+
+ + )} +
) } diff --git a/ui/src/components/intranet/IntranetDashboard/index.tsx b/ui/src/components/intranet/IntranetDashboard/index.tsx index add031fb..b42fea3b 100644 --- a/ui/src/components/intranet/IntranetDashboard/index.tsx +++ b/ui/src/components/intranet/IntranetDashboard/index.tsx @@ -12,7 +12,7 @@ import { HiArrowTrendingDown as ArrowTrendingDownIcon, HiXMark, HiEye, - HiPaperClip + HiPaperClip, } from 'react-icons/hi2' import dayjs from 'dayjs' import 'dayjs/locale/tr' @@ -25,7 +25,8 @@ import { mockAnniversaries, mockQuickLinks, mockTasks, - Announcement + mockDocuments, + Announcement, } from '../../../mocks/mockIntranetData' dayjs.locale('tr') @@ -37,36 +38,49 @@ const IntranetDashboard: React.FC = () => { const [selectedAnnouncement, setSelectedAnnouncement] = useState(null) // Bugünün etkinlikleri - const todayEvents = mockEvents.filter(event => - event.isPublished && dayjs(event.date).isSame(dayjs(), 'day') + const todayEvents = mockEvents.filter( + (event) => event.isPublished && dayjs(event.date).isSame(dayjs(), 'day'), ) // Yaklaşan etkinlikler (7 gün içinde) - const upcomingEvents = mockEvents.filter(event => - event.isPublished && - dayjs(event.date).isAfter(dayjs()) && - dayjs(event.date).isBefore(dayjs().add(7, 'day')) + const upcomingEvents = mockEvents.filter( + (event) => + event.isPublished && + dayjs(event.date).isAfter(dayjs()) && + dayjs(event.date).isBefore(dayjs().add(7, 'day')), ) - // Bu haftaki doğum günleri - const weekBirthdays = mockBirthdays.filter(b => - dayjs(b.date).isBetween(dayjs().startOf('week'), dayjs().endOf('week')) - ) + // Bugün doğanlar (sadece ay ve günü karşılaştır) + const todayBirthdays = mockBirthdays.filter((b) => { + const birthDate = dayjs(b.date) + const today = dayjs() + return birthDate.month() === today.month() && birthDate.date() === today.date() + }) + + // Bu haftaki doğum günleri (sadece ay ve günü karşılaştır) + const weekBirthdays = mockBirthdays.filter((b) => { + const birthDate = dayjs(b.date) + const today = dayjs() + const weekStart = today.startOf('week') + const weekEnd = today.endOf('week') + + // Bu yılki doğum gününü oluştur + const thisBirthday = today.year(today.year()).month(birthDate.month()).date(birthDate.date()) + return thisBirthday.isBetween(weekStart, weekEnd, null, '[]') + }) // Bu ayki iş yıldönümleri - const monthAnniversaries = mockAnniversaries.filter(a => - dayjs(a.hireDate).month() === dayjs().month() + const monthAnniversaries = mockAnniversaries.filter( + (a) => dayjs(a.hireDate).month() === dayjs().month(), ) // Öncelikli görevler - const priorityTasks = mockTasks.filter(t => - t.priority === 'high' || t.priority === 'urgent' - ).slice(0, 3) + const priorityTasks = mockTasks + .filter((t) => t.priority === 'high' || t.priority === 'urgent') + .slice(0, 3) // Sabitlenmiş duyurular - const pinnedAnnouncements = mockAnnouncements - .filter(a => a.isPinned) - .slice(0, 3) + const pinnedAnnouncements = mockAnnouncements.filter((a) => a.isPinned).slice(0, 3) const getCategoryColor = (category: string) => { const colors: Record = { @@ -74,7 +88,7 @@ const IntranetDashboard: React.FC = () => { hr: 'bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300', it: 'bg-orange-100 dark:bg-orange-900/30 text-orange-700 dark:text-orange-300', event: 'bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300', - urgent: 'bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300' + urgent: 'bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300', } return colors[category] || colors.general } @@ -84,7 +98,7 @@ const IntranetDashboard: React.FC = () => { low: 'bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300', medium: 'bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-300', high: 'bg-orange-100 dark:bg-orange-900/30 text-orange-600 dark:text-orange-300', - urgent: 'bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-300' + urgent: 'bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-300', } return colors[priority] } @@ -126,8 +140,8 @@ const IntranetDashboard: React.FC = () => {
{pinnedAnnouncements.map((announcement) => ( -
setSelectedAnnouncement(announcement)} className="p-6 hover:bg-gray-50 dark:hover:bg-gray-700/50 cursor-pointer transition-colors" > @@ -142,7 +156,9 @@ const IntranetDashboard: React.FC = () => {

{announcement.title}

- + {announcement.category === 'general' && 'Genel'} {announcement.category === 'hr' && 'İK'} {announcement.category === 'it' && 'IT'} @@ -214,7 +230,9 @@ const IntranetDashboard: React.FC = () => {

{task.title}

- + {task.priority === 'urgent' && '🔥 Acil'} {task.priority === 'high' && 'Yüksek'} {task.priority === 'medium' && 'Orta'} @@ -278,6 +296,46 @@ const IntranetDashboard: React.FC = () => {
+ {/* Bugün Doğanlar */} +
+
+

+ 🎂 Bugün Doğanlar +

+ {todayBirthdays.length > 0 ? ( +
+ {todayBirthdays.map((birthday, index) => ( +
+ {birthday.employee.fullName} +
+

+ {birthday.employee.fullName} +

+

+ {birthday.age} yaşında 🎉 +

+

+ {birthday.employee.department?.name || 'Genel'} +

+
+
+ ))} +
+ ) : ( +

+ Bugün doğan yok +

+ )} +
+
+ {/* Yaklaşan Etkinlikler */}
@@ -287,17 +345,70 @@ const IntranetDashboard: React.FC = () => {
- {upcomingEvents.slice(0, 3).map((event) => ( + {upcomingEvents.length > 0 ? ( + upcomingEvents.slice(0, 3).map((event) => ( +
+

+ {event.title} +

+

+ {dayjs(event.date).format('DD MMMM YYYY')} - {event.location} +

+
+ )) + ) : ( +

+ Yaklaşan etkinlik yok +

+ )} +
+
+ + {/* Dokümanlar */} +
+
+
+

+ + Son Dokümanlar +

+ +
+
+
+ {mockDocuments.slice(0, 5).map((doc) => (
-

- {event.title} -

-

- {dayjs(event.date).format('DD MMMM YYYY')} - {event.location} -

+
+
+ +
+
+

+ {doc.name} +

+

+ {doc.category === 'policy' && '📋 Politika'} + {doc.category === 'procedure' && '📝 Prosedür'} + {doc.category === 'form' && '📄 Form'} + {doc.category === 'template' && '� Şablon'} + {doc.category === 'report' && '📊 Rapor'} + {doc.category === 'other' && '📄 Diğer'} +

+
+ {dayjs(doc.uploadDate).fromNow()} + + {doc.size} +
+
+
))}
@@ -364,97 +475,103 @@ const IntranetDashboard: React.FC = () => { )}
+
- {/* Announcement Detail Modal */} - - {selectedAnnouncement && ( - <> + {/* Announcement Detail Modal */} + + {selectedAnnouncement && ( + <> + setSelectedAnnouncement(null)} + /> +
setSelectedAnnouncement(null)} - /> -
- e.stopPropagation()} - > - {/* Header */} -
-
-
-
- - {selectedAnnouncement.category === 'general' && '📢 Genel'} - {selectedAnnouncement.category === 'hr' && '👥 İnsan Kaynakları'} - {selectedAnnouncement.category === 'it' && '💻 Bilgi Teknolojileri'} - {selectedAnnouncement.category === 'event' && '🎉 Etkinlik'} - {selectedAnnouncement.category === 'urgent' && '🚨 Acil'} - - {selectedAnnouncement.isPinned && ( - 📌 Sabitlenmiş - )} -
-

- {selectedAnnouncement.title} -

+ initial={{ opacity: 0, scale: 0.95, y: 20 }} + animate={{ opacity: 1, scale: 1, y: 0 }} + exit={{ opacity: 0, scale: 0.95, y: 20 }} + className="bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-3xl w-full" + onClick={(e) => e.stopPropagation()} + > + {/* Header */} +
+
+
+
+ + {selectedAnnouncement.category === 'general' && '📢 Genel'} + {selectedAnnouncement.category === 'hr' && '👥 İnsan Kaynakları'} + {selectedAnnouncement.category === 'it' && '💻 Bilgi Teknolojileri'} + {selectedAnnouncement.category === 'event' && '🎉 Etkinlik'} + {selectedAnnouncement.category === 'urgent' && '🚨 Acil'} + + {selectedAnnouncement.isPinned && ( + 📌 Sabitlenmiş + )}
- +

+ {selectedAnnouncement.title} +

+ +
- {/* Author Info */} -
- {selectedAnnouncement.author.fullName} -
-

- {selectedAnnouncement.author.fullName} -

-
- {dayjs(selectedAnnouncement.publishDate).format('DD MMMM YYYY, HH:mm')} - - - - {selectedAnnouncement.viewCount} görüntülenme - -
+ {/* Author Info */} +
+ {selectedAnnouncement.author.fullName} +
+

+ {selectedAnnouncement.author.fullName} +

+
+ + {dayjs(selectedAnnouncement.publishDate).format('DD MMMM YYYY, HH:mm')} + + + + + {selectedAnnouncement.viewCount} görüntülenme +
+
- {/* Content */} -
- {/* Image if exists */} - {selectedAnnouncement.imageUrl && ( - {selectedAnnouncement.title} - )} + {/* Content */} +
+ {/* Image if exists */} + {selectedAnnouncement.imageUrl && ( + {selectedAnnouncement.title} + )} - {/* Full Content */} -
-

- {selectedAnnouncement.content} -

-
+ {/* Full Content */} +
+

+ {selectedAnnouncement.content} +

+
- {/* Attachments */} - {selectedAnnouncement.attachments && selectedAnnouncement.attachments.length > 0 && ( + {/* Attachments */} + {selectedAnnouncement.attachments && + selectedAnnouncement.attachments.length > 0 && (

@@ -487,8 +604,9 @@ const IntranetDashboard: React.FC = () => {

)} - {/* Departments */} - {selectedAnnouncement.departments && selectedAnnouncement.departments.length > 0 && ( + {/* Departments */} + {selectedAnnouncement.departments && + selectedAnnouncement.departments.length > 0 && (

Hedef Departmanlar @@ -506,32 +624,31 @@ const IntranetDashboard: React.FC = () => {

)} - {/* Expiry Date */} - {selectedAnnouncement.expiryDate && ( -
-

- Son Geçerlilik Tarihi:{' '} - {dayjs(selectedAnnouncement.expiryDate).format('DD MMMM YYYY')} -

-
- )} -
+ {/* Expiry Date */} + {selectedAnnouncement.expiryDate && ( +
+

+ Son Geçerlilik Tarihi:{' '} + {dayjs(selectedAnnouncement.expiryDate).format('DD MMMM YYYY')} +

+
+ )} +
- {/* Footer */} -
- -
- -
- - )} - -
+ {/* Footer */} +
+ +
+ +
+ + )} +
) } diff --git a/ui/src/components/intranet/IntranetSidebar.tsx b/ui/src/components/intranet/IntranetSidebar.tsx index 9d18dda8..a96b2ba5 100644 --- a/ui/src/components/intranet/IntranetSidebar.tsx +++ b/ui/src/components/intranet/IntranetSidebar.tsx @@ -13,6 +13,9 @@ import { HiBuildingOffice2, HiClipboardDocumentCheck, HiUserPlus, + HiBars3, + HiXMark, + HiChevronLeft, } from 'react-icons/hi2' import { mockTasks, @@ -127,6 +130,8 @@ interface IntranetSidebarProps { const IntranetSidebar: React.FC = ({ activePath, onNavigate }) => { const [expandedMenus, setExpandedMenus] = useState(['hr']) + const [isCollapsed, setIsCollapsed] = useState(false) + const [isMobileOpen, setIsMobileOpen] = useState(false) // Dinamik badge sayılarını hesapla const badgeCounts = useMemo(() => { @@ -180,6 +185,7 @@ const IntranetSidebar: React.FC = ({ activePath, onNavigat toggleMenu(item.id) } else if (item.path) { onNavigate(item.path) + setIsMobileOpen(false) } }} className={`w-full flex items-center justify-between px-3 py-2.5 rounded-lg transition-colors ${ @@ -187,28 +193,34 @@ const IntranetSidebar: React.FC = ({ activePath, onNavigat ? 'bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300' : 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800' } ${level > 0 ? 'ml-6' : ''}`} + title={isCollapsed ? item.label : undefined} > -
- - {item.label} -
-
- {item.badge && item.badge > 0 && ( - - {item.badge} - - )} - {hasChildren && ( - - - - )} +
+ + {!isCollapsed && {item.label}}
+ {!isCollapsed && ( +
+ {item.badge && item.badge > 0 && ( + + {item.badge} + + )} + {hasChildren && ( + + + + )} +
+ )} {hasChildren && ( - {isExpanded && ( + {isExpanded && !isCollapsed && ( = ({ activePath, onNavigat } return ( -
-
-

İntranet Portal

-
+ <> + {/* Mobile Toggle Button */} + - -
+ {/* Mobile Overlay */} + + {isMobileOpen && ( + setIsMobileOpen(false)} + className="lg:hidden fixed inset-0 bg-black/50 z-40" + /> + )} + + + {/* Sidebar */} + +
+ {!isCollapsed ? ( + <> +

+ İntranet Portal +

+ + + ) : ( + + )} +
+ + +
+ ) } diff --git a/ui/src/components/intranet/Reservations/index.tsx b/ui/src/components/intranet/Reservations/index.tsx index f7d6dfa9..030ee1cb 100644 --- a/ui/src/components/intranet/Reservations/index.tsx +++ b/ui/src/components/intranet/Reservations/index.tsx @@ -1,13 +1,6 @@ import React, { useState } from 'react' import { motion, AnimatePresence } from 'framer-motion' -import { - HiKey, - HiCalendar, - HiTruck, - HiCog, - HiPlus, - HiXMark -} from 'react-icons/hi2' +import { HiKey, HiCalendar, HiTruck, HiCog, HiPlus, HiXMark } from 'react-icons/hi2' import dayjs from 'dayjs' import { mockReservations, Reservation } from '../../../mocks/mockIntranetData' @@ -15,9 +8,10 @@ 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 filteredReservations = + selectedType === 'all' + ? mockReservations + : mockReservations.filter((r) => r.type === selectedType) const getTypeIcon = (type: string) => { switch (type) { @@ -36,7 +30,7 @@ const ReservationsModule: React.FC = () => { const labels: Record = { room: 'Toplantı Salonu', vehicle: 'Araç', - equipment: 'Ekipman' + equipment: 'Ekipman', } return labels[type] || type } @@ -46,7 +40,7 @@ const ReservationsModule: React.FC = () => { 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' + completed: 'bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300', } return colors[status] || colors.pending } @@ -56,7 +50,7 @@ const ReservationsModule: React.FC = () => { pending: 'Bekliyor', approved: 'Onaylandı', rejected: 'Reddedildi', - completed: 'Tamamlandı' + completed: 'Tamamlandı', } return labels[status] || status } @@ -67,9 +61,7 @@ const ReservationsModule: React.FC = () => { {/* Header */}
-

- 🔑 Rezervasyonlar -

+

🔑 Rezervasyonlar

Oda, araç ve ekipman rezervasyonları

@@ -89,7 +81,7 @@ const ReservationsModule: React.FC = () => { { 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 } + { value: 'equipment' as const, label: 'Ekipman', icon: HiCog }, ].map((type) => (
- + {getStatusLabel(reservation.status)}
@@ -197,121 +191,121 @@ const ReservationsModule: React.FC = () => {
)}
- - {/* New Reservation Modal */} - - {showNewReservation && ( - <> +
+ + {/* New Reservation Modal */} + + {showNewReservation && ( + <> + setShowNewReservation(false)} + /> +
setShowNewReservation(false)} - /> -
- -
-

- Yeni Rezervasyon Oluştur -

- + initial={{ opacity: 0, scale: 0.95, y: 20 }} + animate={{ opacity: 1, scale: 1, y: 0 }} + exit={{ opacity: 0, scale: 0.95, y: 20 }} + className="bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-2xl w-full" + > +
+

+ Yeni Rezervasyon Oluştur +

+ +
+ +
+
+ +
-
+
+ + +
+ +
- -
- -
- - -
- -
-
- - -
-
- - -
-
- -
-
-
-