multica/apps/web/features/modals/store.ts
Naiyuan Qing 40d29bea50 feat: add global issue search with sidebar button and modal
Add search functionality to quickly find issues by title:
- Backend: add search param (ILIKE) to ListIssues query
- Frontend: search modal using CommandDialog with skeleton loading
- Sidebar: ghost-style search button next to create issue button
- Handle CJK input method composition to avoid premature searches
- Responsive max-height for small screens

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:11:28 +08:00

19 lines
522 B
TypeScript

"use client";
import { create } from "zustand";
type ModalType = "create-workspace" | "create-issue" | "search-issues" | null;
interface ModalStore {
modal: ModalType;
data: Record<string, unknown> | null;
open: (modal: NonNullable<ModalType>, data?: Record<string, unknown> | null) => void;
close: () => void;
}
export const useModalStore = create<ModalStore>((set) => ({
modal: null,
data: null,
open: (modal, data = null) => set({ modal, data }),
close: () => set({ modal: null, data: null }),
}));