2023-03-30 11:34:41 +00:00
|
|
|
import useSWR from "swr";
|
|
|
|
|
|
|
|
// services
|
|
|
|
import userService from "services/user.service";
|
|
|
|
// layouts
|
2023-04-08 08:16:46 +00:00
|
|
|
import { WorkspaceAuthorizationLayout } from "layouts/auth-layout";
|
|
|
|
// components
|
|
|
|
import { Feeds } from "components/core";
|
2023-03-30 11:34:41 +00:00
|
|
|
// ui
|
|
|
|
import { Loader } from "components/ui";
|
|
|
|
import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
|
|
|
|
// fetch-keys
|
|
|
|
import { USER_ACTIVITY } from "constants/fetch-keys";
|
|
|
|
|
|
|
|
const ProfileActivity = () => {
|
|
|
|
const { data: userActivity } = useSWR(USER_ACTIVITY, () => userService.getUserActivity());
|
|
|
|
|
|
|
|
return (
|
2023-04-08 08:16:46 +00:00
|
|
|
<WorkspaceAuthorizationLayout
|
2023-03-30 11:34:41 +00:00
|
|
|
meta={{
|
|
|
|
title: "Plane - My Profile",
|
|
|
|
}}
|
|
|
|
breadcrumbs={
|
|
|
|
<Breadcrumbs>
|
|
|
|
<BreadcrumbItem title="My Profile Activity" />
|
|
|
|
</Breadcrumbs>
|
|
|
|
}
|
|
|
|
profilePage
|
|
|
|
>
|
|
|
|
{userActivity ? (
|
2023-03-31 17:30:28 +00:00
|
|
|
userActivity.results.length > 0 ? (
|
|
|
|
<Feeds activities={userActivity.results} />
|
|
|
|
) : null
|
2023-03-30 11:34:41 +00:00
|
|
|
) : (
|
|
|
|
<Loader className="space-y-5">
|
|
|
|
<Loader.Item height="40px" />
|
|
|
|
<Loader.Item height="40px" />
|
|
|
|
<Loader.Item height="40px" />
|
|
|
|
<Loader.Item height="40px" />
|
|
|
|
</Loader>
|
|
|
|
)}
|
2023-04-08 08:16:46 +00:00
|
|
|
</WorkspaceAuthorizationLayout>
|
2023-03-30 11:34:41 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ProfileActivity;
|