2023-09-13 17:43:25 +03:00
|
|
|
"use client";
|
|
|
|
import { useEffect } from "react";
|
|
|
|
|
|
|
|
import { useSupabase } from "@/lib/context/SupabaseProvider";
|
|
|
|
import { redirectToPreviousPageOrChatPage } from "@/lib/helpers/redirectToPreviousPageOrChatPage";
|
2023-06-15 12:52:46 +03:00
|
|
|
|
2023-05-23 13:45:10 +03:00
|
|
|
import Features from "./Features";
|
2023-05-18 14:37:03 +03:00
|
|
|
import Hero from "./Hero";
|
|
|
|
|
2023-06-15 12:52:46 +03:00
|
|
|
const HomePage = (): JSX.Element => {
|
2023-09-13 17:43:25 +03:00
|
|
|
const { session } = useSupabase();
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
if (session?.user !== undefined) {
|
|
|
|
redirectToPreviousPageOrChatPage();
|
|
|
|
}
|
|
|
|
}, [session?.user]);
|
2023-05-21 02:20:55 +03:00
|
|
|
|
2023-05-18 14:37:03 +03:00
|
|
|
return (
|
2023-06-29 14:18:30 +03:00
|
|
|
<main data-testid="home-page">
|
2023-05-18 14:37:03 +03:00
|
|
|
<Hero />
|
2023-05-23 13:45:10 +03:00
|
|
|
<Features />
|
2023-05-18 14:37:03 +03:00
|
|
|
</main>
|
|
|
|
);
|
2023-06-15 12:52:46 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
export default HomePage;
|