feat: date and time picker (#13985)
This commit is contained in:
parent
4a332ff1af
commit
19d413ac1e
39 changed files with 1234 additions and 1 deletions
|
|
@ -0,0 +1,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
|
||||
Loading…
Add table
Add a link
Reference in a new issue