"use client"; import * as React from "react"; import { FileText, LayoutList, Search, Share2, Users, Wifi, WifiOff, } from "lucide-react"; import { useEditor, toRichText } from "tldraw"; import { cn } from "@/lib/utils"; export type WhiteboardToolbarProps = { className?: string; readOnly?: boolean; /** When set, shows live collaboration status */ collab?: { isConnected: boolean; isSynced: boolean; }; }; export function WhiteboardToolbar({ className, collab, readOnly = false }: WhiteboardToolbarProps) { const editor = useEditor(); const [projectPickerOpen, setProjectPickerOpen] = React.useState(false); const dropAtViewportCenter = React.useCallback( (kind: "task" | "document") => { const b = editor.getViewportPageBounds(); const cx = b.x + b.w / 2 - 120; const cy = b.y + b.h / 2 - 80; if (kind === "task") { editor.createShapes([ { type: "note", x: cx, y: cy, props: { color: "violet", size: "m", richText: toRichText("Task (placeholder)"), }, meta: { whiteboardCard: "task" }, }, ]); } else { editor.createShapes([ { type: "geo", x: cx, y: cy, props: { w: 280, h: 160, geo: "rectangle", color: "light-blue", fill: "solid", richText: toRichText("Document (placeholder)"), }, meta: { whiteboardCard: "document" }, }, ]); } }, [editor], ); return ( <>
{collab ? ( <> {collab.isConnected ? ( ) : ( )} {collab.isConnected ? (collab.isSynced ? "Live" : "Syncing") : "Offline"} ) : ( Local )}
{projectPickerOpen ? (

Add from project

Project search and picker will plug in here. This is a stub for now.

) : null} ); }