[#205] added calendar list component (#258)

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
Camille Moussu
2025-10-31 04:44:54 +01:00
committed by GitHub
parent 2686b13885
commit 39d8085766
7 changed files with 71 additions and 62 deletions
+7 -10
View File
@@ -33,6 +33,7 @@ import {
addVideoConferenceToDescription,
} from "../../utils/videoConferenceUtils";
import { TimezoneAutocomplete } from "../Timezone/TimezoneAutocomplete";
import { CalendarItemList } from "../Calendar/CalendarItemList";
// Helper component for field with label
export const FieldWithLabel = React.memo(
@@ -113,8 +114,8 @@ interface EventFormFieldsProps {
setEventClass: (eventClass: string) => void;
timezone: string;
setTimezone: (timezone: string) => void;
calendarid: number;
setCalendarid: (calendarid: number) => void;
calendarid: string;
setCalendarid: (calendarid: string) => void;
hasVideoConference: boolean;
setHasVideoConference: (hasVideoConference: boolean) => void;
meetingLink: string | null;
@@ -144,7 +145,7 @@ interface EventFormFieldsProps {
newStart: string,
newEnd: string
) => void;
onCalendarChange?: (newCalendarId: number) => void;
onCalendarChange?: (newCalendarId: string) => void;
// Validation
onValidationChange?: (isValid: boolean) => void;
@@ -370,7 +371,7 @@ export default function EventFormFields({
onAllDayChange?.(newAllDay, newStart, newEnd);
};
const handleCalendarChange = (newCalendarId: number) => {
const handleCalendarChange = (newCalendarId: string) => {
setCalendarid(newCalendarId);
onCalendarChange?.(newCalendarId);
};
@@ -738,14 +739,10 @@ export default function EventFormFields({
label={!showMore ? "Calendar" : ""}
displayEmpty
onChange={(e: SelectChangeEvent) =>
handleCalendarChange(Number(e.target.value))
handleCalendarChange(e.target.value)
}
>
{Object.keys(userPersonnalCalendars).map((calendar, index) => (
<MenuItem key={index} value={index}>
{userPersonnalCalendars[index].name}
</MenuItem>
))}
{CalendarItemList(userPersonnalCalendars)}
</Select>
</FormControl>
</FieldWithLabel>