import '../styles/index.css'
import UserContext from '../context/user'

export default function MyApp({ Component, pageProps }) {
  const { username, role } = pageProps?.user || {}

  return (
    <div className="wrapper">
      <UserContext.Provider value={{ username, role }}>
        <Component {...pageProps} />
      </UserContext.Provider>
    </div>
  )
}
