fp/services/next/app/components/video-context.tsx

55 lines
1.5 KiB
TypeScript

import { createContext } from "react";
import { ITagVodRelation } from "@/app/lib/tag-vod-relations";
export interface IVideoContextValue {
timeStamp: number;
setTimeStamp: Function;
tvrs: ITagVodRelation[];
setTvrs: Function;
}
// const defaultContextValue = {
// timeStamp: 3,
// setTimeStamp: () => null,
// ref: null,
// }
export const VideoContext = createContext<IVideoContextValue>({} as IVideoContextValue);
// export function VideoContextProvider({ children }: IAuthContextProps): React.JSX.Element {
// const { value: authData, set: setAuthData } = useLocalStorageValue<IAuthData | null>('authData', {
// defaultValue: null,
// });
// const { value: lastVisitedPath, set: setLastVisitedPath } = useLocalStorageValue<string>('lastVisitedPath', {
// defaultValue: '/profile',
// initializeWithValue: false,
// });
// const router = useRouter();
// const login = async () => {
// const currentPath = window.location.pathname;
// setLastVisitedPath(currentPath);
// router.push(`${strapiUrl}/api/connect/patreon`);
// };
// const logout = () => {
// setAuthData({ accessToken: null, user: null });
// };
// return (
// <AuthContext.Provider
// value={{
// authData,
// setAuthData,
// lastVisitedPath,
// login,
// logout,
// }}
// >
// {children}
// </AuthContext.Provider>
// );
// }