feat: add command palette with cross-board search and actions
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useState } from "react";
|
||||
import { useState, useEffect } from "react";
|
||||
import { Plus } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useAppStore } from "@/stores/app-store";
|
||||
@@ -9,6 +9,17 @@ export function BoardList() {
|
||||
const boards = useAppStore((s) => s.boards);
|
||||
const [dialogOpen, setDialogOpen] = useState(false);
|
||||
|
||||
// Listen for custom event to open new board dialog from command palette
|
||||
useEffect(() => {
|
||||
function handleOpenDialog() {
|
||||
setDialogOpen(true);
|
||||
}
|
||||
document.addEventListener("open-new-board-dialog", handleOpenDialog);
|
||||
return () => {
|
||||
document.removeEventListener("open-new-board-dialog", handleOpenDialog);
|
||||
};
|
||||
}, []);
|
||||
|
||||
if (boards.length === 0) {
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user