mirror of
https://codeberg.org/MarkusThielker/next-ory.git
synced 2025-07-02 12:59:20 +00:00
NORY-15: add identity search
This commit is contained in:
parent
0ac5c67dfe
commit
59ed13b2cc
2 changed files with 61 additions and 6 deletions
|
@ -2,12 +2,25 @@ import React, { Suspense } from 'react';
|
|||
import { DataTableFallback } from '@/components/ui/data-table-fallback';
|
||||
import { IdentityDataTable } from '@/app/user/data-table';
|
||||
import { getIdentityApi } from '@/ory/sdk/server';
|
||||
import { SearchInput } from '@/components/search-input';
|
||||
|
||||
export default async function UserPage() {
|
||||
export default async function UserPage(
|
||||
{
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{ [key: string]: string | string[] | undefined }>
|
||||
},
|
||||
) {
|
||||
|
||||
const identityApi = await getIdentityApi();
|
||||
|
||||
const { data } = await identityApi.listIdentities();
|
||||
const params = await searchParams;
|
||||
const query = params.query ? params.query as string : '';
|
||||
|
||||
const data = await identityApi.listIdentities({
|
||||
pageSize: 100,
|
||||
previewCredentialsIdentifierSimilar: query,
|
||||
}).then(response => response.data);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col space-y-4">
|
||||
|
@ -16,10 +29,12 @@ export default async function UserPage() {
|
|||
<p className="text-lg font-light">See and manage all identities registered with your Ory Kratos
|
||||
instance</p>
|
||||
</div>
|
||||
|
||||
<Suspense fallback={<DataTableFallback columnCount={5} rowCount={20}/>}>
|
||||
<IdentityDataTable data={data}/>
|
||||
</Suspense>
|
||||
<div className="flex flex-col space-y-2">
|
||||
<SearchInput queryParamKey="query" placeholder="Search"/>
|
||||
<Suspense fallback={<DataTableFallback columnCount={5} rowCount={20}/>}>
|
||||
<IdentityDataTable data={data}/>
|
||||
</Suspense>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue