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

55 lines
1.5 KiB
TypeScript
Raw Normal View History

2024-01-20 16:16:14 +00:00
2024-07-10 22:11:18 +00:00
import { createContext } from "react";
import { ITagVodRelation } from "@/app/lib/tag-vod-relations";
2024-01-20 16:16:14 +00:00
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>
// );
// }