+
diff --git a/ui/src/pages/tablo.tsx b/ui/src/pages/tablo.tsx
index fb29b74..1f7e17c 100644
--- a/ui/src/pages/tablo.tsx
+++ b/ui/src/pages/tablo.tsx
@@ -18,6 +18,7 @@ import {
} from "@ui/hooks/tablos";
import { LoadingSpinner } from "@ui/components/LoadingSpinner";
import { TabloInsert, TabloUpdate, UserTablo } from "@ui/types/tablos.types";
+import { useNavigate } from "react-router-dom";
type FilterOption = {
id: "all" | "owned" | "invited";
@@ -39,6 +40,7 @@ export const TabloPage = () => {
const [filterType, setFilterType] = useState<"all" | "owned" | "invited">(
"all"
);
+ const navigate = useNavigate();
const { data: tablos, isLoading, error } = useTablosList();
const createTabloMutation = useCreateTablo();
@@ -56,9 +58,18 @@ export const TabloPage = () => {
});
const menuItems = [
- { name: "Conversations" },
- { name: "Planning" },
- { name: "Notes" },
+ {
+ name: "Conversations",
+ action: (tabloId: string) => navigate(`/chat/${tabloId}`),
+ },
+ {
+ name: "Planning",
+ action: (tabloId: string) => navigate(`/tablo/${tabloId}/planning`),
+ },
+ {
+ name: "Notes",
+ action: (tabloId: string) => navigate(`/tablo/${tabloId}/notes`),
+ },
];
const openCreateModal = () => {
@@ -431,7 +442,7 @@ export const TabloPage = () => {
className="w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"
onClick={(e) => {
e.stopPropagation();
- console.log(`${item.name} clicked for ${tablo.name}`);
+ item.action(tablo.id);
}}
>
{item.name}
diff --git a/ui/src/providers/ChatProvider.tsx b/ui/src/providers/ChatProvider.tsx
index c9ed980..86edb02 100644
--- a/ui/src/providers/ChatProvider.tsx
+++ b/ui/src/providers/ChatProvider.tsx
@@ -1,11 +1,12 @@
import { Chat, useCreateChatClient } from "stream-chat-react";
import { useUser } from "./UserStoreProvider";
import { LoadingSpinner } from "@ui/components/LoadingSpinner";
+import { StreamChat } from "stream-chat";
export default function ChatProvider({
children,
}: {
- children: React.ReactNode;
+ children: (client: StreamChat) => React.ReactNode;
}) {
const apiKey = import.meta.env.VITE_STREAM_CHAT_API_KEY as string;
const user = useUser();
@@ -41,7 +42,7 @@ export default function ChatProvider({
return (
- {children}
+ {children(client)}
);
}