plane/apps/app/pages/[workspaceSlug]/me/profile/activity.tsx

47 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-03-30 11:34:41 +00:00
import useSWR from "swr";
// services
import userService from "services/user.service";
// layouts
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 (
<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>
)}
</WorkspaceAuthorizationLayout>
2023-03-30 11:34:41 +00:00
);
};
export default ProfileActivity;