replace alerts with toasts
This commit is contained in:
@@ -14,6 +14,7 @@ import { parseICS, generateICS } from '@/lib/ical'
|
||||
import type { CalendarEvent } from '@/lib/types'
|
||||
import { Textarea } from '@/components/ui/textarea'
|
||||
import { useSession } from 'next-auth/react'
|
||||
import { toast } from 'sonner'
|
||||
|
||||
export default function HomePage() {
|
||||
const [events, setEvents] = useState<CalendarEvent[]>([])
|
||||
@@ -128,7 +129,7 @@ export default function HomePage() {
|
||||
if (file.name.endsWith('.ics')) {
|
||||
handleImport(file)
|
||||
} else {
|
||||
alert('Please drop an .ics file')
|
||||
toast.warning('Please drop an .ics file')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,7 +146,7 @@ export default function HomePage() {
|
||||
})
|
||||
|
||||
if (res.status === 401) {
|
||||
alert('Please sign in to use AI features.')
|
||||
toast.info('Please sign in to use AI features.')
|
||||
setAiLoading(false)
|
||||
return
|
||||
}
|
||||
@@ -185,11 +186,11 @@ export default function HomePage() {
|
||||
setSummaryUpdated(new Date().toLocaleString())
|
||||
}
|
||||
} else {
|
||||
alert('AI did not return event data.')
|
||||
toast.error('AI did not return event data.')
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
alert('Error from AI service.')
|
||||
toast.error('Error from AI service.')
|
||||
} finally {
|
||||
setAiLoading(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user