import React, { useState } from 'react' import { AnimatePresence } from 'framer-motion' import dayjs from 'dayjs' import 'dayjs/locale/tr' import relativeTime from 'dayjs/plugin/relativeTime' import isBetween from 'dayjs/plugin/isBetween' // Widgets import TodayBirthdays from './widgets/TodayBirthdays' import UpcomingEvents from './widgets/UpcomingEvents' import RecentDocuments from './widgets/RecentDocuments' import ImportantAnnouncements from './widgets/ImportantAnnouncements' import PriorityTasks from './widgets/PriorityTasks' import MealWeeklyMenu from './widgets/MealWeeklyMenu' import ShuttleSchedule from './widgets/ShuttleSchedule' import LeaveManagement from './widgets/LeaveManagement' import OvertimeManagement from './widgets/OvertimeManagement' import ExpenseManagement from './widgets/ExpenseManagement' import UpcomingTrainings from './widgets/UpcomingTrainings' import ActiveReservations from './widgets/ActiveReservations' import ActiveSurveys from './widgets/ActiveSurveys' import Visitors from './widgets/Visitors' // Modals import SurveyModal from './modals/SurveyModal' import LeaveRequestModal from './modals/LeaveRequestModal' import OvertimeRequestModal from './modals/OvertimeRequestModal' import ExpenseRequestModal from './modals/ExpenseRequestModal' import ReservationRequestModal from './modals/ReservationRequestModal' import AnnouncementDetailModal from './modals/AnnouncementDetailModal' // Social Wall import SocialWall from './SocialWall' import { Announcement, Survey } from '@/types/intranet' import { Container } from '@/components/shared' dayjs.locale('tr') dayjs.extend(relativeTime) dayjs.extend(isBetween) const IntranetDashboard: React.FC = () => { const [selectedAnnouncement, setSelectedAnnouncement] = useState(null) const [selectedSurvey, setSelectedSurvey] = useState(null) const [showSurveyModal, setShowSurveyModal] = useState(false) const [showLeaveModal, setShowLeaveModal] = useState(false) const [showOvertimeModal, setShowOvertimeModal] = useState(false) const [showExpenseModal, setShowExpenseModal] = useState(false) const [showReservationModal, setShowReservationModal] = useState(false) const handleTakeSurvey = (survey: Survey) => { setSelectedSurvey(survey) setShowSurveyModal(true) } const handleSubmitSurvey = () => { setShowSurveyModal(false) setSelectedSurvey(null) } const handleSubmitLeave = () => { setShowLeaveModal(false) } const handleSubmitOvertime = () => { setShowOvertimeModal(false) } const handleSubmitExpense = () => { setShowExpenseModal(false) } const handleSubmitReservation = () => { setShowReservationModal(false) } return (

Hoş geldiniz,{' '} {dayjs().format('DD MMMM YYYY dddd')}

setShowReservationModal(true)} />
setShowLeaveModal(true)} /> setShowOvertimeModal(true)} /> setShowExpenseModal(true)} />
{showSurveyModal && selectedSurvey && ( setShowSurveyModal(false)} onSubmit={handleSubmitSurvey} /> )} {showLeaveModal && ( setShowLeaveModal(false)} onSubmit={handleSubmitLeave} /> )} {showOvertimeModal && ( setShowOvertimeModal(false)} onSubmit={handleSubmitOvertime} /> )} {showExpenseModal && ( setShowExpenseModal(false)} onSubmit={handleSubmitExpense} /> )} {showReservationModal && ( setShowReservationModal(false)} onSubmit={handleSubmitReservation} /> )} {selectedAnnouncement && ( setSelectedAnnouncement(null)} /> )}
) } export default IntranetDashboard