Wire quick actions to reopen admin modals in-place

This commit is contained in:
Esdras Renan 2025-11-13 21:55:56 -03:00
parent 8db3b20a40
commit 6a75a0a9ed
4 changed files with 47 additions and 2 deletions

View file

@ -436,6 +436,15 @@ export function AdminCompaniesManager({ initialCompanies, tenantId, autoOpenCrea
}
}, [autoOpenCreate, openCreate])
useEffect(() => {
if (typeof window === "undefined") return
const handler = () => {
openCreate()
}
window.addEventListener("quick-open-company", handler)
return () => window.removeEventListener("quick-open-company", handler)
}, [openCreate])
const handleDelete = useCallback(async () => {
if (!isDeleting) return
try {