import { Button, ButtonGroup, Dialog, DialogActions, DialogContent, DialogTitle, FormControlLabel, Radio, RadioGroup, } from "twake-mui"; import { CalendarEvent } from "../../features/Events/EventsTypes"; import { useState } from "react"; import { useI18n } from "twake-i18n"; export function EditModeDialog({ type, setOpen, event, eventAction, }: { type: string | null; setOpen: (e: string | null) => void; event: CalendarEvent; eventAction: (type: "solo" | "all" | undefined) => void; }) { const { t } = useI18n(); const [typeOfAction, setTypeOfAction] = useState<"solo" | "all" | undefined>( "solo" ); const handleEvent = async () => { eventAction(typeOfAction); handleClose(); }; const handleClose = () => { setOpen(null); setTypeOfAction("solo"); }; return ( {type === "edit" && t("editModeDialog.updateRecurrentEvent")} {type === "attendance" && t("editModeDialog.updateParticipationStatus")} setTypeOfAction(e.target.value as "solo" | "all" | undefined) } > } label={t("editModeDialog.thisEvent")} /> } label={t("editModeDialog.allEvents")} /> ); }