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"; export default function Aside() { const [{ tab }] = useAtom(asideStateAtom); let title: string; let component: ReactNode; switch (tab) { case "comments": component = ; title = "Comments"; break; default: component = null; title = null; } return ( {component && ( <> {title}
{component}
)}
); }