mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
fix: linting
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import React, { createContext, useContext, useEffect } from 'react';
|
||||
import logPageViewAction from './actions';
|
||||
import React, { createContext, useContext, useEffect } from "react";
|
||||
import logPageViewAction from "./actions";
|
||||
|
||||
const PageViewContext = createContext<null>(null);
|
||||
|
||||
export const PageViewProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
||||
|
||||
export const PageViewProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||
children,
|
||||
}) => {
|
||||
useEffect(() => {
|
||||
const logPageView = async () => {
|
||||
const pageViewData = { page: window.location.pathname, data: {} };
|
||||
@@ -12,14 +13,11 @@ export const PageViewProvider: React.FC<{ children: React.ReactNode }> = ({ chil
|
||||
};
|
||||
|
||||
logPageView().catch(console.error);
|
||||
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<PageViewContext.Provider value={null}>
|
||||
{children}
|
||||
</PageViewContext.Provider>
|
||||
<PageViewContext.Provider value={null}>{children}</PageViewContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export const usePageViews = () => useContext(PageViewContext);
|
||||
export const usePageViews = () => useContext(PageViewContext);
|
||||
|
||||
Reference in New Issue
Block a user