36 lines
792 B
TypeScript
36 lines
792 B
TypeScript
'use client'
|
|
|
|
import { Auth } from "@/model/Auth";
|
|
import { User } from "@/model/User";
|
|
import { ReactNode, createContext } from "react";
|
|
import { Attributes, InferAttributes } from "@sequelize/core";
|
|
|
|
|
|
export type AuthProps = {
|
|
auth?: Attributes<Auth>
|
|
user?: Attributes<User>
|
|
}
|
|
let p: AuthProps = {}
|
|
|
|
export type AdminViewProps = {
|
|
view: string;
|
|
}
|
|
|
|
let avp: AdminViewProps = {
|
|
view: "home",
|
|
}
|
|
|
|
export const AdminViewContext = createContext(avp);
|
|
export const AuthContext = createContext(p);
|
|
|
|
|
|
interface Props {
|
|
children?: ReactNode;
|
|
params?: any;
|
|
}
|
|
|
|
export default function Providers(props:Props){
|
|
return (
|
|
<AuthContext.Provider value={{}}><AdminViewContext.Provider value={avp}>{props.children}</AdminViewContext.Provider></AuthContext.Provider>
|
|
)
|
|
} |