Auto-open modals from global quick actions
This commit is contained in:
parent
59a94744b3
commit
abb29d9116
7 changed files with 70 additions and 11 deletions
|
|
@ -9,9 +9,13 @@ import { fetchCompaniesByTenant, normalizeCompany } from "@/server/company-servi
|
|||
export const runtime = "nodejs"
|
||||
export const dynamic = "force-dynamic"
|
||||
|
||||
export default async function AdminUsersPage() {
|
||||
export default async function AdminUsersPage({
|
||||
searchParams,
|
||||
}: { searchParams: Promise<Record<string, string | string[] | undefined>> }) {
|
||||
const session = await requireStaffSession()
|
||||
const tenantId = session.user.tenantId ?? DEFAULT_TENANT_ID
|
||||
const params = await searchParams
|
||||
const autoOpenCreateUser = params.quick === "new-user"
|
||||
|
||||
const users = await prisma.user.findMany({
|
||||
where: {
|
||||
|
|
@ -103,7 +107,12 @@ export default async function AdminUsersPage() {
|
|||
}
|
||||
>
|
||||
<div className="mx-auto w-full max-w-7xl px-4 pb-12 lg:px-8">
|
||||
<AdminUsersWorkspace initialAccounts={accounts} companies={companies} tenantId={tenantId} />
|
||||
<AdminUsersWorkspace
|
||||
initialAccounts={accounts}
|
||||
companies={companies}
|
||||
tenantId={tenantId}
|
||||
autoOpenCreate={autoOpenCreateUser}
|
||||
/>
|
||||
</div>
|
||||
</AppShell>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue