Replace the landing with the artifact design and rebuild the admin in Ant Design.
Adds consultation leads, section editors, and the one-time content reset for this release. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import type { LeadSource } from "@montech/shared";
|
||||
|
||||
const DEFAULT_CONSULT_TYPE = "طلا و جواهر";
|
||||
|
||||
/** Consultation modal state shared by the header, hero, solution cards, banners and the AI modal. */
|
||||
export function useConsultModal() {
|
||||
const isOpen = useState("consult-open", () => false);
|
||||
const mounted = useState("consult-mounted", () => false);
|
||||
const type = useState("consult-type", () => DEFAULT_CONSULT_TYPE);
|
||||
const source = useState<LeadSource>("consult-source", () => "consult");
|
||||
const aiQuery = useState<string>("consult-ai-query", () => "");
|
||||
|
||||
function open(opts: { type?: string; source?: LeadSource; aiQuery?: string } = {}) {
|
||||
if (opts.type) type.value = opts.type;
|
||||
source.value = opts.source ?? "consult";
|
||||
aiQuery.value = opts.aiQuery ?? "";
|
||||
mounted.value = true;
|
||||
isOpen.value = true;
|
||||
}
|
||||
|
||||
function close() {
|
||||
isOpen.value = false;
|
||||
}
|
||||
|
||||
function resetType() {
|
||||
type.value = DEFAULT_CONSULT_TYPE;
|
||||
}
|
||||
|
||||
return { isOpen, mounted, type, source, aiQuery, open, close, resetType };
|
||||
}
|
||||
|
||||
export function useAiModal() {
|
||||
const isOpen = useState("ai-open", () => false);
|
||||
const mounted = useState("ai-mounted", () => false);
|
||||
const query = useState("ai-query", () => "");
|
||||
|
||||
function open() {
|
||||
mounted.value = true;
|
||||
isOpen.value = true;
|
||||
}
|
||||
|
||||
function close() {
|
||||
isOpen.value = false;
|
||||
}
|
||||
|
||||
return { isOpen, mounted, query, open, close };
|
||||
}
|
||||
Reference in New Issue
Block a user