feat: implement project development module, transfer management features, and industrial AVM model integration

This commit is contained in:
Ho Ngoc Hai
2026-04-18 20:34:35 +07:00
parent 0f3b4d7b0d
commit 38b9def99a
66 changed files with 9051 additions and 17 deletions

View File

@@ -0,0 +1,41 @@
import { create } from 'zustand';
/**
* UI state for the listing inquiry modal.
*
* Lives in a Zustand store so that:
* - any component (e.g. floating CTAs, sticky "Nhắn tin" bars) can open the
* modal without prop drilling through the listing detail tree
* - tests and devtools can inspect / drive modal state directly
*/
export interface InquiryModalTarget {
listingId: string;
listingTitle: string;
sellerName: string;
}
export interface InquiryModalState {
/** Whether the inquiry modal is currently open. */
isOpen: boolean;
/** The listing being inquired about (null when the modal is closed). */
target: InquiryModalTarget | null;
/** Open the modal for a given listing. */
openInquiry: (target: InquiryModalTarget) => void;
/** Close the modal and clear the active target. */
closeInquiry: () => void;
/** Update open state directly (used by Radix onOpenChange). */
setOpen: (open: boolean) => void;
}
export const useInquiryStore = create<InquiryModalState>((set) => ({
isOpen: false,
target: null,
openInquiry: (target) => set({ isOpen: true, target }),
closeInquiry: () => set({ isOpen: false, target: null }),
setOpen: (open) =>
set((state) => ({
isOpen: open,
target: open ? state.target : null,
})),
}));