wwf
2025-05-20 938c3e5a587ce950a94964ea509b9e7f8834dfae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import type { FC } from 'react'
import type { CalendarProps } from '../types'
import { DaysOfWeek } from './days-of-week'
import CalendarItem from './item'
 
const Calendar: FC<CalendarProps> = ({
  days,
  selectedDate,
  onDateClick,
  wrapperClassName,
}) => {
  return <div className={wrapperClassName}>
    <DaysOfWeek/>
    <div className='grid grid-cols-7 gap-0.5 p-2'>
      {
        days.map(day => <CalendarItem
          key={day.date.format('YYYY-MM-DD')}
          day={day}
          selectedDate={selectedDate}
          onClick={onDateClick}
        />)
      }
    </div>
  </div>
}
 
export default Calendar