{error &&
{error}
}
{/* Title */}
setTitle(e.target.value)}
placeholder={language === 'de' ? 'Titel hinzufügen' : 'Add title'}
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}
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)}
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))}
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)} 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))}
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)} 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 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]
);
}}
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')}
style={inlineSelect}
>
{language === 'de' ? 'Nie' : 'Never'}
{language === 'de' ? 'Am Datum' : 'On Date'}
{language === 'de' ? 'Nach...' : 'After...'}
{recurrenceEndType === 'date' && (
setRecurrenceEndDateValue(e.target.value)}
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))}
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 */}
{/* Alert */}
{reminders.length === 0 ? (
{language === 'de' ? 'Erinnerung hinzufügen' : 'Add reminder'}
) : (
reminders.map((reminder, idx) => (
updateReminder(idx, parseInt(e.target.value))}
style={{ ...inlineSelect, flex: 1 }}
>
{REMINDER_OPTIONS.map(opt => (
{opt.label}
))}
setReminders(reminders.filter((_, i) => i !== idx))}
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: '2px', color: 'var(--weekly-text-light)', opacity: 0.5 }}>
))
)}
{reminders.length > 0 && reminders.length < 2 && (
+ {language === 'de' ? 'Weitere Erinnerung' : 'Add another'}
)}
{/* Status & Visibility chips */}
setBusyStatus(e.target.value)} style={{ ...inlineSelect, fontSize: '0.75rem' }}>
{BUSY_STATUS_OPTIONS.map(opt => (
{opt.label}
))}
|
setVisibility(e.target.value)} style={{ ...inlineSelect, fontSize: '0.75rem' }}>
{VISIBILITY_OPTIONS.map(opt => (
{opt.label}
))}
{/* URL (Conditional) */}
{supportsURL && (
)}
{/* Invitees & Attachments toggle */}
setShowMoreOptions(!showMoreOptions)}
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)}
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)}
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: '1px', color: 'var(--weekly-text-light)', flexShrink: 0 }}>
))}
)}
)}