create auth session provider
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
'use client'
|
||||
"use client"
|
||||
|
||||
import { useEffect, useState } from 'react'
|
||||
import { nanoid } from 'nanoid'
|
||||
@@ -13,9 +13,9 @@ import { addEvent, deleteEvent, getAllEvents, clearEvents, getDB } from '@/lib/d
|
||||
import { parseICS, generateICS } from '@/lib/ical'
|
||||
import type { CalendarEvent } from '@/lib/types'
|
||||
import { Textarea } from '@/components/ui/textarea'
|
||||
import { auth } from '@/auth'
|
||||
import { useSession } from 'next-auth/react'
|
||||
|
||||
export default async function HomePage() {
|
||||
export default function HomePage() {
|
||||
const [events, setEvents] = useState<CalendarEvent[]>([])
|
||||
const [dialogOpen, setDialogOpen] = useState(false)
|
||||
const [editingId, setEditingId] = useState<string | null>(null)
|
||||
@@ -44,7 +44,7 @@ export default async function HomePage() {
|
||||
})()
|
||||
}, [])
|
||||
|
||||
const session = await auth()
|
||||
const { data: session, status } = useSession()
|
||||
|
||||
const resetForm = () => {
|
||||
setTitle('')
|
||||
|
||||
Reference in New Issue
Block a user