create auth session provider

This commit is contained in:
2025-08-16 19:26:19 -04:00
parent 0696382d43
commit 0e919ea69b
3 changed files with 34 additions and 19 deletions

View File

@@ -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('')