import "../styles/globals.css";
import "../../node_modules/prism-themes/themes/prism-dracula.css";
import React from "react";
import { PagePropsType } from "@/src/types";
import {
    BunextRootComponentProps,
    BunextHTMLProps,
    BunextRouteConfig,
} from "@moduletrace/bunext/types";

export type AppContextType = {
    pageProps: PagePropsType;
    query?: any;
    url?: URL;
};

export const AppContext = React.createContext<AppContextType>({
    pageProps: {},
});

export default function TbenPersonalSite({
    children,
    props,
    query,
    url,
}: BunextRootComponentProps) {
    return (
        <AppContext.Provider value={{ pageProps: props || {}, query, url }}>
            {children as any}
        </AppContext.Provider>
    );
}

export const html_props: BunextHTMLProps = {
    lang: "en",
    className: "dark",
};

export const config: BunextRouteConfig = {
    cacheExpiry: 60 * 60, // 1 hour
    cachePage: true,
};
