mirror of
https://github.com/linsa-io/linsa.git
synced 2026-03-24 01:51:24 +01:00
32 lines
952 B
TypeScript
32 lines
952 B
TypeScript
import * as React from "react"
|
|
import { useAccount } from "@/lib/providers/jazz-provider"
|
|
import { NavItem } from "~/components/custom/nav-item"
|
|
|
|
export const LinkCollection: React.FC = () => {
|
|
const { me } = useAccount({
|
|
root: {
|
|
personalLinks: [],
|
|
personalPages: [],
|
|
topicsWantToLearn: [],
|
|
topicsLearning: [],
|
|
topicsLearned: [],
|
|
},
|
|
})
|
|
|
|
const linkCount = me?.root.personalLinks?.length || 0
|
|
const pageCount = me?.root.personalPages?.length || 0
|
|
|
|
const topicCount =
|
|
(me?.root.topicsWantToLearn?.length || 0) +
|
|
(me?.root.topicsLearning?.length || 0) +
|
|
(me?.root.topicsLearned?.length || 0)
|
|
|
|
return (
|
|
<div className="flex flex-col gap-px py-2">
|
|
<NavItem to="/links" title="Links" icon="Link" count={linkCount} />
|
|
<NavItem to="/topics" title="Topics" icon="Hash" count={topicCount} />
|
|
<NavItem to="/pages" title="Pages" icon="Layers" count={pageCount} />
|
|
</div>
|
|
)
|
|
}
|