();
+ const isLoading = !response && !error;
+ const [data, totalCount] = response ?? [];
+
+ return (
+ <>
+ }
+ pagination={{
+ page,
+ totalCount,
+ pageSize,
+ onChange: setPage,
+ }}
+ isLoading={isLoading}
+ errorMessage={error?.toString()}
+ rowGroups={[{ key: 'data', data }]}
+ columns={[
+ {
+ dataIndex: 'application',
+ title: t('applications.application_name'),
+ colSpan: 4,
+ render: (data) => ,
+ },
+ {
+ dataIndex: 'roles',
+ title: t('organization_details.roles'),
+ colSpan: 6,
+ render: ({ organizationRoles }) => {
+ if (organizationRoles.length === 0) {
+ return '-';
+ }
+
+ return (
+
+ {organizationRoles.map(({ id, name }) => (
+
+
+
+ ))}
+
+ );
+ },
+ },
+ {
+ dataIndex: 'actions',
+ title: null,
+ colSpan: 1,
+ render: (data) => (
+ {
+ setAppToBeEdited(data);
+ }}
+ onDelete={async () => {
+ await api.delete(`api/organizations/${organization.id}/applications/${data.id}`);
+ void mutate();
+ }}
+ />
+ ),
+ },
+ ]}
+ rowIndexKey="id"
+ filter={
+
+
{
+ setKeyword(value);
+ setPage(1);
+ }}
+ onClearSearch={() => {
+ setKeyword('');
+ setPage(1);
+ }}
+ />
+
+ }
+ />
+ {appToBeEdited && (
+ {
+ setAppToBeEdited(undefined);
+ void mutate();
+ }}
+ />
+ )}
+ {
+ setIsModalOpen(false);
+ void mutate();
+ }}
+ />
+ >
+ );
+}
+
+export default MachineToMachine;
diff --git a/packages/console/src/pages/OrganizationDetails/Members/AddMembersToOrganization.tsx b/packages/console/src/pages/OrganizationDetails/Members/AddMembersToOrganization.tsx
index c2c373f17..b93209440 100644
--- a/packages/console/src/pages/OrganizationDetails/Members/AddMembersToOrganization.tsx
+++ b/packages/console/src/pages/OrganizationDetails/Members/AddMembersToOrganization.tsx
@@ -1,4 +1,4 @@
-import { type User, type Organization } from '@logto/schemas';
+import { type User, type Organization, RoleType } from '@logto/schemas';
import { useEffect, useState } from 'react';
import { Controller, useForm } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
@@ -34,25 +34,25 @@ function AddMembersToOrganization({ organization, isOpen, onClose }: Props) {
formState: { isSubmitting },
} = useForm<{
users: User[];
- scopes: Array