Files
docmost/apps/client/src/components/layouts/dashboard/aside.tsx
Philipinho 1412f1d982 client: updates
* work on groups ui
* move settings to its own page
* other fixes and refactoring
2024-04-04 22:19:15 +01:00

43 lines
947 B
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/navbar/atoms/sidebar-atom.ts";
import React from "react";
export default function Aside() {
const [{ tab }] = useAtom(asideStateAtom);
let title;
let component;
switch (tab) {
case "comments":
component = <CommentList />;
title = "Comments";
break;
default:
component = null;
title = null;
}
return (
<Box p="md">
{component && (
<>
<Text mb="md" fw={500}>
{title}
</Text>
<ScrollArea
style={{ height: "85vh" }}
scrollbarSize={5}
type="scroll"
>
<div style={{ paddingBottom: "200px" }}>{component}</div>
</ScrollArea>
</>
)}
</Box>
);
}