This commit is contained in:
Robert 2024-03-07 05:33:08 +07:00
parent 7f281cd82b
commit e948e38c20
No known key found for this signature in database
GPG Key ID: F631C7FD957D5F22
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1 @@
export { default as Sidebar } from "./ui/Sidebar";

View File

@ -0,0 +1,38 @@
import { useParams } from "@tanstack/react-router";
import { useChainState } from "@/entities/chain/model";
import List from "@/shared/ui/List";
import { Button } from "@mui/material";
export default function Sidebar() {
const params = useParams({ strict: false });
const chains = useChainState((state) => state.chains || []);
// @ts-ignore
const chainId: string | undefined = params.chainId;
return (
<div className="no-scrollbar h-screen w-[250px] overflow-y-scroll bg-bg-color px-4 pb-8">
<List.Root className="mt-8 space-y-2">
{chains.map((chain, index) => (
<List.LinkItem
key={index}
to={`/$namespace/${chain._id}`}
isSelected={chainId == chain._id}
>
{chain.name}
</List.LinkItem>
))}
</List.Root>
<div className="mt-4">
<Button
variant="outlined"
sx={{ width: "100%", fontWeight: "semibold" }}
>
<span className="mr-2 text-2xl font-light">+</span>Добавить
</Button>
</div>
</div>
);
}