import { Box, ScrollArea, Text } from "@mantine/core"; import CommentListWithTabs from "@/features/comment/components/comment-list-with-tabs.tsx"; import { useAtom } from "jotai"; import { asideStateAtom } from "@/components/layouts/global/hooks/atoms/sidebar-atom.ts"; import React, { ReactNode } from "react"; import { useTranslation } from "react-i18next"; import { TableOfContents } from "@/features/editor/components/table-of-contents/table-of-contents.tsx"; import { useAtomValue } from "jotai"; import { pageEditorAtom } from "@/features/editor/atoms/editor-atoms.ts"; import AsideChatPanel from "@/ee/ai-chat/components/aside-chat-panel"; import { PageDetailsAside } from "@/features/page-details/components/page-details-aside.tsx"; export default function Aside() { const [{ tab }] = useAtom(asideStateAtom); const { t } = useTranslation(); const pageEditor = useAtomValue(pageEditorAtom); let title: string; let component: ReactNode; switch (tab) { case "comments": component = ; title = "Comments"; break; case "toc": component = ; title = "Table of contents"; break; case "chat": component = ; title = "AI Chat"; break; case "details": component = ; title = "Details"; break; default: component = null; title = null; } return ( {component && ( <> {tab !== "chat" && ( {t(title)} )} {tab === "comments" || tab === "chat" ? ( component ) : (
{component}
)} )}
); }