mirror of
https://github.com/docmost/docmost.git
synced 2026-06-11 02:28:24 +08:00
670ee64179
* feat: support i18n * feat: wip support i18n * feat: complete space translation * feat: complete page translation * feat: update space translation * feat: update workspace translation * feat: update group translation * feat: update workspace translation * feat: update page translation * feat: update user translation * chore: update pnpm-lock * feat: add query translation * refactor: merge to single file * chore: remove necessary code * feat: save language to BE * fix: only load current language * feat: save language to locale column * fix: cleanups * add language menu to preferences page * new translations * translate editor * Translate editor placeholders * translate space selection component --------- Co-authored-by: Philip Okugbe <phil@docmost.com> Co-authored-by: Philip Okugbe <16838612+Philipinho@users.noreply.github.com>
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import { Box, ScrollArea, Text } from "@mantine/core";
|
|
import CommentList from "@/features/comment/components/comment-list.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";
|
|
|
|
export default function Aside() {
|
|
const [{ tab }] = useAtom(asideStateAtom);
|
|
const { t } = useTranslation();
|
|
|
|
let title: string;
|
|
let component: ReactNode;
|
|
|
|
switch (tab) {
|
|
case "comments":
|
|
component = <CommentList />;
|
|
title = "Comments";
|
|
break;
|
|
default:
|
|
component = null;
|
|
title = null;
|
|
}
|
|
|
|
return (
|
|
<Box p="md">
|
|
{component && (
|
|
<>
|
|
<Text mb="md" fw={500}>
|
|
{t(title)}
|
|
</Text>
|
|
|
|
<ScrollArea
|
|
style={{ height: "85vh" }}
|
|
scrollbarSize={5}
|
|
type="scroll"
|
|
>
|
|
<div style={{ paddingBottom: "200px" }}>{component}</div>
|
|
</ScrollArea>
|
|
</>
|
|
)}
|
|
</Box>
|
|
);
|
|
}
|