import { useRouter } from "next/router";
import Link from "next/link";
import useSWR from "swr";
import { Disclosure, Transition } from "@headlessui/react";
import { observer } from "mobx-react-lite";
// hooks
import { useUser } from "hooks/store";
// services
import { UserService } from "services/user.service";
// components
import { ProfileSidebarTime } from "./time";
// ui
import { Loader, Tooltip } from "@plane/ui";
// icons
import { ChevronDown, Pencil } from "lucide-react";
// helpers
import { renderFormattedDate } from "helpers/date-time.helper";
import { renderEmoji } from "helpers/emoji.helper";
// fetch-keys
import { USER_PROFILE_PROJECT_SEGREGATION } from "constants/fetch-keys";
// services
const userService = new UserService();
export const ProfileSidebar = observer(() => {
// router
const router = useRouter();
const { workspaceSlug, userId } = router.query;
// store hooks
const { currentUser } = useUser();
const { data: userProjectsData } = useSWR(
workspaceSlug && userId ? USER_PROFILE_PROJECT_SEGREGATION(workspaceSlug.toString(), userId.toString()) : null,
workspaceSlug && userId
? () => userService.getUserProfileProjectsSegregation(workspaceSlug.toString(), userId.toString())
: null
);
const userDetails = [
{
label: "Joined on",
value: renderFormattedDate(userProjectsData?.user_data.date_joined ?? ""),
},
{
label: "Timezone",
value: