import React, { useState } from 'react'; const Calendar = () => { const [date, setDate] = useState(new Date()); const [selectedDate, setSelectedDate] = useState(new Date().getDate()); const scheduledInterviews = { 15: "Interview with TechCorp" }; const daysInMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(); const firstDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay(); const monthName = date.toLocaleString('default', { month: 'long' }); const year = date.getFullYear(); const handlePrevMonth = () => setDate(new Date(date.getFullYear(), date.getMonth() - 1, 1)); const handleNextMonth = () => setDate(new Date(date.getFullYear(), date.getMonth() + 1, 1)); const calendarDays = Array.from({ length: firstDayOfMonth }, (_, i) =>
); for (let day = 1; day <= daysInMonth; day++) { const isToday = new Date().toDateString() === new Date(date.getFullYear(), date.getMonth(), day).toDateString(); const isSelected = day === selectedDate; const hasInterview = scheduledInterviews[day]; calendarDays.push(
setSelectedDate(day)} style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '40px', width: '40px', margin: 'auto', cursor: 'pointer', borderRadius: '50%', backgroundColor: isToday ? '#FBBF24' : 'transparent', border: isSelected ? '2px solid #FCD34D' : '2px solid transparent', color: isToday ? '#1a202c' : 'white', position: 'relative' }}> {day} {hasInterview &&
}
); } return (

{monthName} {year}

{['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'].map(day =>
{day}
)} {calendarDays}

{scheduledInterviews[selectedDate] ? `Interview on ${monthName} ${selectedDate}` : 'No interviews scheduled on this date.'}

{scheduledInterviews[selectedDate] &&

{scheduledInterviews[selectedDate]}

}
); }; export default Calendar;