import '../styles/globals.css'
import { GeistProvider, CssBaseline } from '@geist-ui/core'
import { useState } from 'react'
import type { AppProps as NextAppProps } from "next/app";
export type ThemeProps = {
theme: "light" | "dark" | string,
changeTheme: () => void
}
type AppProps
= {
pageProps: P;
} & Omit, "pageProps">;
export type DriftProps = ThemeProps
function MyApp({ Component, pageProps }: AppProps) {
const [themeType, setThemeType] = useState(typeof window !== 'undefined' ? localStorage.getItem('drift-theme') || 'light' : 'light')
const changeTheme = () => {
const newTheme = themeType === 'dark' ? 'light' : 'dark'
localStorage.setItem('drift-theme', newTheme)
setThemeType(last => (last === 'dark' ? 'light' : 'dark'))
}
return (
)
}
export default MyApp