@@ -46,7 +46,7 @@ const EventsTab = ({ events, setEvents }) => {
4646 ...eventDefaults [ initialEventType ]
4747 } ;
4848 } ) ;
49-
49+
5050 // State to track if we're editing an existing event
5151 const [ editingEventId , setEditingEventId ] = useState ( null ) ;
5252
@@ -79,21 +79,21 @@ const EventsTab = ({ events, setEvents }) => {
7979 const addEvent = ( ) => {
8080 if ( currentEvent . name ) {
8181 // Validate required fields based on event type
82-
82+
8383 // For Schedule, func_act is required
8484 if ( [ 'Schedule' , 'ScheduleList' ] . includes ( currentEvent . type ) && ! currentEvent . func_act ) {
8585 alert ( 'func_act is required for Schedule events' ) ;
8686 return ;
8787 }
88-
88+
8989 // For other event types, both func_evt and func_act are typically required
9090 if ( ! [ 'Schedule' , 'ScheduleList' ] . includes ( currentEvent . type ) && ( ! currentEvent . func_evt || ! currentEvent . func_act ) ) {
9191 alert ( 'Both func_evt and func_act are required for this event type' ) ;
9292 return ;
9393 }
9494
9595 setEvents ( prev => [ ...prev , { ...currentEvent , id : Date . now ( ) } ] ) ;
96-
96+
9797 // Reset to defaults for current type
9898 const resetDefaults = eventDefaults [ currentEvent . type ] || { } ;
9999 setCurrentEvent ( {
@@ -111,23 +111,23 @@ const EventsTab = ({ events, setEvents }) => {
111111
112112 const saveEditedEvent = ( ) => {
113113 if ( currentEvent . name ) {
114-
114+
115115 // For Schedule, func_act is required
116116 if ( currentEvent . type === 'Schedule' && ! currentEvent . func_act ) {
117117 alert ( 'func_act is required for Schedule events' ) ;
118118 return ;
119119 }
120-
120+
121121 // For other event types, both func_evt and func_act are typically required
122122 if ( currentEvent . type !== 'Schedule' && ( ! currentEvent . func_evt || ! currentEvent . func_act ) ) {
123123 alert ( 'Both func_evt and func_act are required for this event type' ) ;
124124 return ;
125125 }
126126
127- setEvents ( prev => prev . map ( event =>
127+ setEvents ( prev => prev . map ( event =>
128128 event . id === editingEventId ? { ...currentEvent } : event
129129 ) ) ;
130-
130+
131131 // Reset form and exit edit mode
132132 cancelEdit ( ) ;
133133 }
@@ -179,7 +179,7 @@ const EventsTab = ({ events, setEvents }) => {
179179 < h2 style = { { color : '#ffffff' , marginBottom : '20px' } } >
180180 { editingEventId ? 'Edit Event' : 'Add New Event' }
181181 </ h2 >
182-
182+
183183 < div style = { { display : 'flex' , flexDirection : 'column' , gap : '20px' } } >
184184 < div style = { { width : '100%' , maxWidth : '400px' } } >
185185 < label style = { { color : '#ffffff' , display : 'block' , marginBottom : '8px' } } >
@@ -203,7 +203,7 @@ const EventsTab = ({ events, setEvents }) => {
203203 </ div >
204204
205205 < div style = { { width : '100%' , maxWidth : '400px' } } >
206- < label style = { { color : '#ffffff' , display : 'block' , marginBottom : '8px' } } >
206+ < label style = { { color : '#ffffff' , display : 'block' , marginBottom : '8px' } } >
207207 Event Type:
208208 </ label >
209209 < select
@@ -241,15 +241,15 @@ const EventsTab = ({ events, setEvents }) => {
241241 const defaultValue = typeDefaults [ key ] ;
242242 const placeholder = defaultValue !== undefined && defaultValue !== null ?
243243 String ( defaultValue ) : '' ;
244-
244+
245245 // Check if this is a function parameter (contains 'func' in the name)
246246 const isFunctionParam = key . toLowerCase ( ) . includes ( 'func' ) ;
247247
248248 return (
249249 < div key = { key } style = { { width : '100%' , maxWidth : isFunctionParam ? '600px' : '400px' } } >
250- < label style = { {
251- color : '#ffffff' ,
252- display : 'block' ,
250+ < label style = { {
251+ color : '#ffffff' ,
252+ display : 'block' ,
253253 marginBottom : '8px' ,
254254 fontSize : '14px' ,
255255 fontWeight : '500' ,
@@ -354,7 +354,7 @@ const EventsTab = ({ events, setEvents }) => {
354354 { /* Events List */ }
355355 < div style = { { maxWidth : '800px' , margin : '0 auto' } } >
356356 < h2 style = { { color : '#ffffff' , marginBottom : '20px' , textAlign : 'center' } } > Defined Events ({ events . length } )</ h2 >
357-
357+
358358 { events . length === 0 ? (
359359 < div style = { {
360360 backgroundColor : '#2a2a3f' ,
@@ -385,9 +385,9 @@ const EventsTab = ({ events, setEvents }) => {
385385 { event . name } ({ event . type } )
386386 </ h3 >
387387 { editingEventId === event . id && (
388- < span style = { {
389- color : '#007bff' ,
390- fontSize : '12px' ,
388+ < span style = { {
389+ color : '#007bff' ,
390+ fontSize : '12px' ,
391391 fontStyle : 'italic' ,
392392 marginTop : '4px' ,
393393 display : 'block'
@@ -434,12 +434,12 @@ const EventsTab = ({ events, setEvents }) => {
434434 . filter ( ( [ key ] ) => key !== 'id' && key !== 'name' && key !== 'type' )
435435 . map ( ( [ key , value ] ) => {
436436 const isFunctionParam = key . toLowerCase ( ) . includes ( 'func' ) ;
437-
437+
438438 return (
439439 < div key = { key } >
440- < h4 style = { {
441- color : '#ccc' ,
442- margin : '0 0 8px 0' ,
440+ < h4 style = { {
441+ color : '#ccc' ,
442+ margin : '0 0 8px 0' ,
443443 fontSize : '14px' ,
444444 textTransform : 'capitalize'
445445 } } >
0 commit comments