import { ReactElement, useState } from "react"; import { observer } from "mobx-react"; //hooks import { Button } from "@plane/ui"; import { PageHead } from "@/components/core"; import { SidebarHamburgerToggle } from "@/components/core/sidebar/sidebar-menu-hamburger-toggle"; import { ProfileActivityListPage } from "@/components/profile"; import { useApplication } from "@/hooks/store"; // layouts import { ProfileSettingsLayout } from "@/layouts/settings-layout"; // components // ui // type import { NextPageWithLayout } from "@/lib/types"; const PER_PAGE = 100; const ProfileActivityPage: NextPageWithLayout = observer(() => { // states const [pageCount, setPageCount] = useState(1); const [totalPages, setTotalPages] = useState(0); const [resultsCount, setResultsCount] = useState(0); // store hooks const { theme: themeStore } = useApplication(); const updateTotalPages = (count: number) => setTotalPages(count); const updateResultsCount = (count: number) => setResultsCount(count); const handleLoadMore = () => setPageCount((prev) => prev + 1); const activityPages: JSX.Element[] = []; for (let i = 0; i < pageCount; i++) activityPages.push( ); const isLoadMoreVisible = pageCount < totalPages && resultsCount !== 0; return ( <>
themeStore.toggleSidebar()} />

Activity

{activityPages} {isLoadMoreVisible && (
)}
); }); ProfileActivityPage.getLayout = function getLayout(page: ReactElement) { return {page}; }; export default ProfileActivityPage;