@@ -7,7 +7,7 @@ import React from 'react';
77ComponentRegistry . register ( 'calendar-view' ,
88 ( { schema, className, onAction, ...props } : { schema : CalendarViewSchema ; className ?: string ; onAction ?: ( action : any ) => void ; [ key : string ] : any } ) => {
99 // Transform schema data to CalendarEvent format
10- const events : CalendarEvent [ ] = React . useMemo ( ( ) => {
10+ const events = React . useMemo ( ( ) => {
1111 if ( ! schema . data || ! Array . isArray ( schema . data ) ) return [ ] ;
1212
1313 return schema . data . map ( ( record : any , index : number ) => {
@@ -34,7 +34,7 @@ ComponentRegistry.register('calendar-view',
3434 }
3535
3636 return {
37- id : record . id || record . _id || index ,
37+ id : String ( record . id || record . _id || index ) ,
3838 title,
3939 start,
4040 end,
@@ -45,7 +45,7 @@ ComponentRegistry.register('calendar-view',
4545 } ) ;
4646 } , [ schema . data , schema . titleField , schema . startDateField , schema . endDateField , schema . colorField , schema . allDayField , schema . colorMapping ] ) ;
4747
48- const handleEventClick = React . useCallback ( ( event : CalendarEvent ) => {
48+ const handleEventClick = React . useCallback ( ( event : any ) => {
4949 if ( onAction ) {
5050 onAction ( {
5151 type : 'event_click' ,
@@ -95,8 +95,8 @@ ComponentRegistry.register('calendar-view',
9595
9696 return (
9797 < CalendarView
98- events = { events }
99- view = { schema . view || 'month' }
98+ events = { events as any [ ] }
99+ view = { ( schema . view as any ) || 'month' }
100100 currentDate = { schema . currentDate ? new Date ( schema . currentDate ) : undefined }
101101 onEventClick = { handleEventClick }
102102 onDateClick = { schema . allowCreate || schema . onDateClick ? handleDateClick : undefined }
0 commit comments