mirror of
https://github.com/langgenius/dify.git
synced 2025-11-30 04:46:44 +00:00
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
30 lines
726 B
TypeScript
30 lines
726 B
TypeScript
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,
|
|
getIsDateDisabled,
|
|
}) => {
|
|
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}
|
|
isDisabled={getIsDateDisabled ? getIsDateDisabled(day.date) : false}
|
|
/>)
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
export default Calendar
|