feat: establish reservation portal foundation
This commit is contained in:
19
resources/js/components/flash-messages.tsx
Normal file
19
resources/js/components/flash-messages.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { usePage } from '@inertiajs/react';
|
||||
import { useEffect } from 'react';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
export function FlashMessages() {
|
||||
const { flash } = usePage().props;
|
||||
|
||||
useEffect(() => {
|
||||
if (flash.success) {
|
||||
toast.success(flash.success);
|
||||
}
|
||||
|
||||
if (flash.error) {
|
||||
toast.error(flash.error);
|
||||
}
|
||||
}, [flash.error, flash.success]);
|
||||
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user