import { useState } from 'react'
import { Session, User } from '../classes'
import { LocalDataContext } from '../context/LocalDataContext'

export const LocalDataProvider = ({ children }: { children: React.ReactNode }) => {
  const [user, setUser] = useState<User>(new User())
  const [sessions, setSessions] = useState<Session[]>([])
  const [users, setUsers] = useState<User[]>([])

  

  return (
    <LocalDataContext.Provider
    value={{ user, setUser, sessions, setSessions, users, setUsers  }}>
      {children}
    </LocalDataContext.Provider>
  )
}


