feat(event-form): replace toast notification with custom ToastInner component

This commit is contained in:
micha 2025-06-19 04:32:09 +02:00
parent e9f60a0d00
commit eb725020f5

View file

@ -14,7 +14,7 @@ import {
import ParticipantListEntry from '@/components/custom-ui/participantListEntry';
import { useRouter } from 'next/navigation';
import { toast } from 'sonner';
import { CalendarCheck } from 'lucide-react';
import { ToastInner } from '@/components/misc/toast-inner';
interface EventFormProps {
type: 'create' | 'edit';
@ -134,10 +134,16 @@ const EventForm: React.FC<EventFormProps> = (props) => {
createEvent({ data });
}
toast('Event saved successfully', {
description: `Your event "${data.title}" has been saved.`,
icon: <CalendarCheck />,
});
toast.custom((t) => (
<ToastInner
toastId={t}
title='Event saved'
description={event?.title}
onAction={() => router.push(`/event/${event?.id}`)}
variant='success'
buttonText='show'
/>
));
router.back();
}