{error &&
{error}
}
{/* Title */}
setTitle(e.target.value)}
placeholder={language === 'de' ? 'Titel hinzufügen' : 'Add title'}
aria-label={language === 'de' ? 'Ereignistitel' : 'Event title'}
aria-describedby={error ? 'cal-event-error' : undefined}
autoFocus
style={{
width: '100%', padding: '3px 0', fontSize: '1rem', fontWeight: 600,
border: 'none', borderBottom: `2px solid ${calColor}`,
background: 'transparent', outline: 'none',
color: 'var(--weekly-text)',
}}
/>
{/* Calendar selector */}
{selectedCal ? getProviderIcon(selectedCal.provider) : null}
!event && setIsCalendarSelectorOpen(!isCalendarSelectorOpen)}
disabled={!!event}
aria-label={language === 'de' ? 'Kalender auswählen' : 'Select calendar'}
aria-expanded={isCalendarSelectorOpen}
aria-haspopup="listbox"
style={{
display: 'flex', alignItems: 'center', gap: '4px',
background: 'transparent', border: 'none', fontWeight: 500,
cursor: event ? 'default' : 'pointer', outline: 'none',
color: 'var(--weekly-text)', fontSize: '0.8rem', padding: '2px 0',
}}
>
{selectedCal?.summary || selectedCal?.title || (language === 'de' ? 'Kalender wählen' : 'Select Calendar')}
{!event && }
{isCalendarSelectorOpen && (
{availableCalendars.map((cal: any) => (
{ setCalendarId(cal.id); setIsCalendarSelectorOpen(false); }}
style={{
display: 'flex', alignItems: 'center', gap: '8px',
padding: '6px 8px', borderRadius: '5px', cursor: 'pointer',
fontSize: '0.8rem', color: 'var(--weekly-text)',
backgroundColor: calendarId === cal.id ? 'var(--weekly-selection, rgba(59, 130, 246, 0.1))' : 'transparent',
transition: 'background 0.2s',
}}
onMouseEnter={(e) => e.currentTarget.style.backgroundColor = 'var(--weekly-hover, rgba(0,0,0,0.05))'}
onMouseLeave={(e) => e.currentTarget.style.backgroundColor = calendarId === cal.id ? 'var(--weekly-selection, rgba(59, 130, 246, 0.1))' : 'transparent'}
>
{cal.summary || cal.title}
{getProviderIcon(cal.provider)}
))}
)}
{/* All Day toggle */}
{/* Start & End times - compact inline */}
{language === 'de' ? 'Von' : 'From'}
handleStartDateChange(e.target.value)}
aria-label={language === 'de' ? 'Startdatum und -uhrzeit' : 'Start date and time'}
style={{
flex: 1, padding: '3px 6px', border: 'none', borderRadius: '5px',
background: 'var(--weekly-bg-secondary, #f3f4f6)',
fontSize: '0.78rem', outline: 'none', color: 'var(--weekly-text)',
minWidth: 0,
}}
/>
{language === 'de' ? 'Bis' : 'To'}
setEndDate(new Date(e.target.value))}
aria-label={language === 'de' ? 'Enddatum und -uhrzeit' : 'End date and time'}
style={{
flex: 1, padding: '3px 6px', border: 'none', borderRadius: '5px',
background: 'var(--weekly-bg-secondary, #f3f4f6)',
fontSize: '0.78rem', outline: 'none', color: 'var(--weekly-text)',
minWidth: 0,
}}
/>
{/* Repeat */}
setRecurrence(e.target.value)} aria-label={language === 'de' ? 'Wiederholung' : 'Recurrence'} style={{ ...inlineSelect, flex: 1 }}>
{language === 'de' ? 'Nie' : 'Never'}
{language === 'de' ? 'Täglich' : 'Every Day'}
{language === 'de' ? 'Wöchentlich' : 'Every Week'}
{language === 'de' ? 'Monatlich' : 'Every Month'}
{language === 'de' ? 'Jährlich' : 'Every Year'}
{language === 'de' ? 'Benutzerdefiniert...' : 'Custom...'}
{/* Custom recurrence options */}
{recurrence === 'custom' && (
{language === 'de' ? 'Alle' : 'Every'}
setCustomInterval(Math.max(1, parseInt(e.target.value) || 1))}
aria-label={language === 'de' ? 'Wiederholungsintervall' : 'Recurrence interval'}
style={{
width: '40px', textAlign: 'center', fontSize: '0.8rem',
background: 'var(--weekly-bg-secondary, #f5f5f5)', borderRadius: '6px',
padding: '3px 4px', border: 'none', outline: 'none', color: 'var(--weekly-text)',
}}
/>
setCustomUnit(e.target.value as any)} aria-label={language === 'de' ? 'Wiederholungseinheit' : 'Recurrence unit'} style={inlineSelect}>
{customInterval === 1 ? (language === 'de' ? 'Tag' : 'Day') : (language === 'de' ? 'Tage' : 'Days')}
{customInterval === 1 ? (language === 'de' ? 'Woche' : 'Week') : (language === 'de' ? 'Wochen' : 'Weeks')}
{customInterval === 1 ? (language === 'de' ? 'Monat' : 'Month') : (language === 'de' ? 'Monate' : 'Months')}
{customInterval === 1 ? (language === 'de' ? 'Jahr' : 'Year') : (language === 'de' ? 'Jahre' : 'Years')}
{customUnit === 'weeks' && (
{(() => {
const allDays = language === 'de' ? ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'] : ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
const allDaysFull = language === 'de' ? ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'] : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
const dayIndices = Array.from({ length: 7 }, (_, i) => (i + weekStartDay) % 7);
return dayIndices.map(dow => (
{
setCustomDays(prev =>
prev.includes(dow) ? (prev.length > 1 ? prev.filter(d => d !== dow) : prev) : [...prev, dow]
);
}}
aria-label={allDaysFull[dow]}
aria-pressed={customDays.includes(dow)}
style={{
width: '28px', height: '28px', borderRadius: '50%',
border: customDays.includes(dow) ? '2px solid #3b82f6' : '1px solid var(--weekly-border, #ddd)',
backgroundColor: customDays.includes(dow) ? '#3b82f6' : 'transparent',
color: customDays.includes(dow) ? 'white' : 'var(--weekly-text)',
fontSize: '0.7rem', fontWeight: 600, cursor: 'pointer',
display: 'flex', alignItems: 'center', justifyContent: 'center',
}}
>
{allDays[dow]}
));
})()}
)}
)}
{/* Recurrence End */}
{recurrence !== 'none' && (
{language === 'de' ? 'Ende' : 'End'}
setRecurrenceEndType(e.target.value as 'never' | 'date' | 'count')}
aria-label={language === 'de' ? 'Wiederholung Ende' : 'Recurrence end'}
style={inlineSelect}
>
{language === 'de' ? 'Nie' : 'Never'}
{language === 'de' ? 'Am Datum' : 'On Date'}
{language === 'de' ? 'Nach...' : 'After...'}
{recurrenceEndType === 'date' && (
setRecurrenceEndDateValue(e.target.value)}
aria-label={language === 'de' ? 'Enddatum der Wiederholung' : 'Recurrence end date'}
style={{
fontSize: '0.8rem', border: 'none', borderRadius: '6px',
background: 'var(--weekly-bg-secondary, #f5f5f5)',
padding: '3px 6px', outline: 'none', color: 'var(--weekly-text)',
}}
/>
)}
{recurrenceEndType === 'count' && (
setRecurrenceCount(Math.max(1, parseInt(e.target.value) || 1))}
aria-label={language === 'de' ? 'Anzahl der Wiederholungen' : 'Number of occurrences'}
style={{
width: '44px', textAlign: 'center', fontSize: '0.8rem',
background: 'var(--weekly-bg-secondary, #f5f5f5)', borderRadius: '6px',
padding: '3px 4px', border: 'none', outline: 'none', color: 'var(--weekly-text)',
}}
/>
{language === 'de' ? 'mal' : 'times'}
)}
)}
{/* Location with autocomplete */}
{ setLocation(e.target.value); updateLocationSuggestions(e.target.value); }}
onFocus={() => { setLocationFocused(true); updateLocationSuggestions(location); }}
onBlur={() => setTimeout(() => setLocationSuggestions([]), 150)}
onKeyDown={e => { if (e.key === 'Escape') setLocationSuggestions([]); }}
placeholder={language === 'de' ? 'Ort hinzufügen' : 'Add location'}
aria-label={language === 'de' ? 'Ort' : 'Location'}
aria-autocomplete="list"
aria-expanded={locationSuggestions.length > 0}
style={{
...fieldCol, padding: '2px 0', border: 'none',
background: 'transparent', outline: 'none', fontSize: '0.8rem',
color: 'var(--weekly-text)',
}}
/>
{locationSuggestions.length > 0 && (
{locationSuggestions.map((suggestion, i) => (
{ e.preventDefault(); setLocation(suggestion); setLocationSuggestions([]); }}
style={{
padding: '6px 10px', fontSize: '0.78rem',
cursor: 'pointer', color: 'var(--weekly-text)',
display: 'flex', alignItems: 'center', gap: '6px',
}}
onMouseEnter={e => (e.currentTarget.style.background = 'var(--weekly-hover, rgba(0,0,0,0.05))')}
onMouseLeave={e => (e.currentTarget.style.background = 'transparent')}
>
{suggestion}
))}
)}
{/* Alert / Reminders */}
{reminders.length === 0 ? (
{language === 'de' ? 'Erinnerung hinzufügen' : 'Add reminder'}
) : (
reminders.map((reminder, idx) => (
updateReminder(idx, parseInt(e.target.value))}
aria-label={`${language === 'de' ? 'Erinnerung' : 'Reminder'} ${idx + 1}`}
style={{ ...inlineSelect, flex: 1 }}
>
{buildReminderOptions().map(opt => (
{opt.label}
))}
{ setReminders(reminders.filter((_, i) => i !== idx)); if (customEditorIdx === idx) setCustomEditorIdx(null); }}
aria-label={language === 'de' ? `Erinnerung ${idx + 1} entfernen` : `Remove reminder ${idx + 1}`}
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: '2px', color: 'var(--weekly-text-light)', opacity: 0.5 }}>
{/* Custom reminder editor row */}
{customEditorIdx === idx && (
setCustomAmount(Math.max(1, parseInt(e.target.value) || 1))}
aria-label={language === 'de' ? 'Erinnerungsmenge' : 'Reminder amount'}
style={{
width: '48px', textAlign: 'center', fontSize: '0.78rem',
background: 'var(--weekly-bg, #fff)', borderRadius: '5px',
padding: '2px 4px', border: '1px solid var(--weekly-border, #ddd)',
outline: 'none', color: 'var(--weekly-text)',
}}
/>
setReminderUnit(e.target.value as any)}
aria-label={language === 'de' ? 'Erinnerungseinheit' : 'Reminder unit'}
style={{ ...inlineSelect, flex: 1, fontSize: '0.75rem' }}
>
{language === 'de' ? 'Minuten' : 'minutes'}
{language === 'de' ? 'Stunden' : 'hours'}
{language === 'de' ? 'Tage' : 'days'}
{language === 'de' ? 'vorher' : 'before'}
confirmCustomReminder(idx)}
title={language === 'de' ? 'Bestätigen' : 'Confirm'}
style={{
background: '#3b82f6', border: 'none', borderRadius: '5px',
cursor: 'pointer', padding: '3px 7px', display: 'flex', alignItems: 'center',
color: '#fff', flexShrink: 0,
}}
>
setCustomEditorIdx(null)}
title={language === 'de' ? 'Abbrechen' : 'Cancel'}
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: '2px', color: 'var(--weekly-text-light)', opacity: 0.6 }}
>
)}
))
)}
{reminders.length > 0 && reminders.length < 2 && (
+ {language === 'de' ? 'Weitere Erinnerung' : 'Add another'}
)}
{/* Status & Visibility chips */}
setBusyStatus(e.target.value)} aria-label={language === 'de' ? 'Status' : 'Busy status'} style={{ ...inlineSelect, fontSize: '0.75rem' }}>
{BUSY_STATUS_OPTIONS.map(opt => (
{opt.label}
))}
|
setVisibility(e.target.value)} aria-label={language === 'de' ? 'Sichtbarkeit' : 'Visibility'} style={{ ...inlineSelect, fontSize: '0.75rem' }}>
{VISIBILITY_OPTIONS.map(opt => (
{opt.label}
))}
{/* URL (Conditional) */}
{supportsURL && (
)}
{/* Invitees & Attachments toggle */}
setShowMoreOptions(!showMoreOptions)}
aria-expanded={showMoreOptions}
aria-label={language === 'de' ? 'Teilnehmer & Anhänge anzeigen' : 'Show invitees & attachments'}
style={{
display: 'flex', alignItems: 'center', gap: '4px',
background: 'none', border: 'none', cursor: 'pointer',
color: 'var(--weekly-text-light)', fontSize: '0.8rem', padding: '0',
}}
>
{language === 'de' ? 'Teilnehmer & Anhänge' : 'Invitees & Attachments'}
{showMoreOptions ? : }
{attendees.length > 0 && {attendees.length} }
{showMoreOptions && (
{/* Attendees */}
{attendees.map((att, idx) => (
{att.displayName ? `${att.displayName} (${att.email})` : att.email}
removeAttendee(att.email)}
aria-label={`${language === 'de' ? 'Teilnehmer entfernen' : 'Remove attendee'}: ${att.displayName || att.email}`}
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: '1px', color: 'var(--weekly-text-light)', flexShrink: 0 }}>
))}
{/* Attachments */}
{supportsAttachments && (
{language === 'de' ? 'Anhänge' : 'Attachments'}
{attachments.map((att, idx) => (
{att.title || att.url}
removeAttachment(att.url)}
aria-label={`${language === 'de' ? 'Anhang entfernen' : 'Remove attachment'}: ${att.title || att.url}`}
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: '1px', color: 'var(--weekly-text-light)', flexShrink: 0 }}>
))}
)}
)}