"use client"; import { useRouter } from "next/navigation"; import { useThreadList, useSdk } from "@lynkd/messaging-inbox-sdk"; import { useUi } from "@/lib/ui-state"; import { Header } from "@/components/nav/Header"; import { Avatar } from "@/components/ui/primitives"; import { RichText } from "@/lib/rich-text"; import { relativeTime } from "@/lib/format"; import { MessagesSquare, Hash } from "lucide-react"; export function ThreadsView() { const { messages, loading } = useThreadList(); const { userById, channelById } = useSdk(); const { openThread } = useUi(); const router = useRouter(); const open = (channelId: string, parentId: string) => { router.push(`/c/${channelId}`); openThread(channelId, parentId); }; return (
{loading &&
Loading…
} {!loading && messages.length === 0 && (
No threads yet
Reply in a thread on any message and it shows up here.
)}
{messages.map((m) => { const author = userById(m.authorId); const ch = m.channelId ? channelById(m.channelId) : undefined; return ( ); })}
); }