@sudobility/entity_pages 0.0.121 → 0.0.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +425 -442
- package/dist/pages/MembersManagementPage.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as t, Fragment as k, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as z from "react";
|
|
3
|
+
import { useState as x } from "react";
|
|
4
|
+
import { createPortal as S } from "react-dom";
|
|
5
|
+
import { ContentLayout as E } from "@sudobility/components";
|
|
6
|
+
import { EntityList as D, MemberList as j, InvitationForm as A, InvitationList as P } from "@sudobility/entity-components";
|
|
7
|
+
import { useEntities as T, useCreateEntity as O, useEntityMembers as $, useUpdateMemberRole as W, useRemoveMember as K, useCreateInvitation as Y, useMyInvitations as q, useAcceptInvitation as U, useDeclineInvitation as B } from "@sudobility/entity_client";
|
|
8
|
+
function G({
|
|
9
|
+
title: r,
|
|
10
|
+
titleId: i,
|
|
11
|
+
...o
|
|
12
|
+
}, n) {
|
|
13
|
+
return /* @__PURE__ */ z.createElement("svg", Object.assign({
|
|
13
14
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
15
|
fill: "none",
|
|
15
16
|
viewBox: "0 0 24 24",
|
|
@@ -17,103 +18,84 @@ function ee({
|
|
|
17
18
|
stroke: "currentColor",
|
|
18
19
|
"aria-hidden": "true",
|
|
19
20
|
"data-slot": "icon",
|
|
20
|
-
ref:
|
|
21
|
-
"aria-labelledby":
|
|
22
|
-
},
|
|
23
|
-
id:
|
|
24
|
-
},
|
|
21
|
+
ref: n,
|
|
22
|
+
"aria-labelledby": i
|
|
23
|
+
}, o), r ? /* @__PURE__ */ z.createElement("title", {
|
|
24
|
+
id: i
|
|
25
|
+
}, r) : null, /* @__PURE__ */ z.createElement("path", {
|
|
25
26
|
strokeLinecap: "round",
|
|
26
27
|
strokeLinejoin: "round",
|
|
27
28
|
d: "M12 4.5v15m7.5-7.5h-15"
|
|
28
29
|
}));
|
|
29
30
|
}
|
|
30
|
-
const
|
|
31
|
+
const I = /* @__PURE__ */ z.forwardRef(G), R = {
|
|
31
32
|
// Background utilities
|
|
32
33
|
background: {
|
|
33
34
|
overlay: "bg-black/50 dark:bg-black/70"
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
|
-
function
|
|
37
|
+
function H() {
|
|
37
38
|
return /* @__PURE__ */ t("div", { className: "space-y-3", role: "status", "aria-label": "Loading workspaces", children: [
|
|
38
|
-
[1, 2, 3].map((
|
|
39
|
+
[1, 2, 3].map((r) => /* @__PURE__ */ e(
|
|
39
40
|
"div",
|
|
40
41
|
{
|
|
41
42
|
className: "h-16 sm:h-20 rounded-lg bg-muted animate-pulse"
|
|
42
43
|
},
|
|
43
|
-
|
|
44
|
+
r
|
|
44
45
|
)),
|
|
45
46
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Loading workspaces..." })
|
|
46
47
|
] });
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
-
client:
|
|
50
|
-
onSelectEntity:
|
|
49
|
+
function ie({
|
|
50
|
+
client: r,
|
|
51
|
+
onSelectEntity: i
|
|
51
52
|
}) {
|
|
52
|
-
const [
|
|
53
|
+
const [o, n] = x(!1), [s, l] = x({
|
|
53
54
|
displayName: "",
|
|
54
55
|
description: ""
|
|
55
|
-
}), [g,
|
|
56
|
-
data:
|
|
57
|
-
isLoading:
|
|
58
|
-
isError:
|
|
56
|
+
}), [g, d] = x(null), {
|
|
57
|
+
data: u = [],
|
|
58
|
+
isLoading: m,
|
|
59
|
+
isError: b,
|
|
59
60
|
error: N,
|
|
60
61
|
refetch: w
|
|
61
|
-
} =
|
|
62
|
-
(
|
|
63
|
-
),
|
|
64
|
-
if (
|
|
65
|
-
|
|
62
|
+
} = T(r), h = O(r), y = u.filter((a) => a.entityType === "personal"), c = u.filter(
|
|
63
|
+
(a) => a.entityType === "organization"
|
|
64
|
+
), v = async (a) => {
|
|
65
|
+
if (a.preventDefault(), d(null), !s.displayName.trim()) {
|
|
66
|
+
d("Display name is required");
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
68
69
|
try {
|
|
69
|
-
await
|
|
70
|
-
displayName:
|
|
71
|
-
description:
|
|
72
|
-
}),
|
|
73
|
-
} catch (
|
|
74
|
-
|
|
70
|
+
await h.mutateAsync({
|
|
71
|
+
displayName: s.displayName.trim(),
|
|
72
|
+
description: s.description.trim() || void 0
|
|
73
|
+
}), n(!1), l({ displayName: "", description: "" });
|
|
74
|
+
} catch (f) {
|
|
75
|
+
d(f.message || "Failed to create organization");
|
|
75
76
|
}
|
|
76
77
|
};
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
|
|
79
|
-
/* @__PURE__ */ t("div", { children: [
|
|
80
|
-
/* @__PURE__ */ e("h1", { className: "text-xl sm:text-2xl font-bold text-foreground", children: "Workspaces" }),
|
|
81
|
-
/* @__PURE__ */ e("p", { className: "text-sm sm:text-base text-muted-foreground", children: "Manage your personal and organization workspaces" })
|
|
82
|
-
] }),
|
|
83
|
-
/* @__PURE__ */ t(
|
|
84
|
-
"button",
|
|
85
|
-
{
|
|
86
|
-
type: "button",
|
|
87
|
-
onClick: () => r(!0),
|
|
88
|
-
"aria-label": "Create new organization",
|
|
89
|
-
className: "flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 w-full sm:w-auto",
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ e(te, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
92
|
-
/* @__PURE__ */ e("span", { children: "New Organization" })
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
)
|
|
96
|
-
] }),
|
|
97
|
-
l && W(
|
|
78
|
+
return /* @__PURE__ */ t(k, { children: [
|
|
79
|
+
o && S(
|
|
98
80
|
/* @__PURE__ */ e(
|
|
99
81
|
"div",
|
|
100
82
|
{
|
|
101
|
-
className: `fixed inset-0 z-50 flex items-center justify-center ${
|
|
83
|
+
className: `fixed inset-0 z-50 flex items-center justify-center ${R.background.overlay} p-4`,
|
|
102
84
|
role: "dialog",
|
|
103
85
|
"aria-modal": "true",
|
|
104
86
|
"aria-label": "Create organization",
|
|
105
|
-
onClick: (
|
|
106
|
-
|
|
87
|
+
onClick: (a) => {
|
|
88
|
+
a.target === a.currentTarget && (n(!1), l({ displayName: "", description: "" }), d(null));
|
|
107
89
|
},
|
|
108
|
-
onKeyDown: (
|
|
109
|
-
|
|
90
|
+
onKeyDown: (a) => {
|
|
91
|
+
a.key === "Escape" && (n(!1), l({ displayName: "", description: "" }), d(null));
|
|
110
92
|
},
|
|
111
93
|
children: /* @__PURE__ */ t("div", { className: "w-full max-w-md rounded-lg bg-background p-4 sm:p-6 shadow-lg", children: [
|
|
112
94
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold mb-4", children: "Create Organization" }),
|
|
113
95
|
/* @__PURE__ */ t(
|
|
114
96
|
"form",
|
|
115
97
|
{
|
|
116
|
-
onSubmit:
|
|
98
|
+
onSubmit: v,
|
|
117
99
|
className: "space-y-4",
|
|
118
100
|
"aria-label": "Create organization form",
|
|
119
101
|
children: [
|
|
@@ -131,10 +113,10 @@ function me({
|
|
|
131
113
|
{
|
|
132
114
|
id: "create-org-name",
|
|
133
115
|
type: "text",
|
|
134
|
-
value:
|
|
135
|
-
onChange: (
|
|
136
|
-
...
|
|
137
|
-
displayName:
|
|
116
|
+
value: s.displayName,
|
|
117
|
+
onChange: (a) => l((f) => ({
|
|
118
|
+
...f,
|
|
119
|
+
displayName: a.target.value
|
|
138
120
|
})),
|
|
139
121
|
placeholder: "My Organization",
|
|
140
122
|
"aria-required": "true",
|
|
@@ -156,10 +138,10 @@ function me({
|
|
|
156
138
|
"textarea",
|
|
157
139
|
{
|
|
158
140
|
id: "create-org-description",
|
|
159
|
-
value:
|
|
160
|
-
onChange: (
|
|
161
|
-
...
|
|
162
|
-
description:
|
|
141
|
+
value: s.description,
|
|
142
|
+
onChange: (a) => l((f) => ({
|
|
143
|
+
...f,
|
|
144
|
+
description: a.target.value
|
|
163
145
|
})),
|
|
164
146
|
placeholder: "What is this organization for?",
|
|
165
147
|
rows: 3,
|
|
@@ -182,10 +164,10 @@ function me({
|
|
|
182
164
|
{
|
|
183
165
|
type: "button",
|
|
184
166
|
onClick: () => {
|
|
185
|
-
|
|
167
|
+
n(!1), l({
|
|
186
168
|
displayName: "",
|
|
187
169
|
description: ""
|
|
188
|
-
}),
|
|
170
|
+
}), d(null);
|
|
189
171
|
},
|
|
190
172
|
className: "px-4 py-2 rounded-lg border hover:bg-muted transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 w-full sm:w-auto",
|
|
191
173
|
children: "Cancel"
|
|
@@ -195,10 +177,10 @@ function me({
|
|
|
195
177
|
"button",
|
|
196
178
|
{
|
|
197
179
|
type: "submit",
|
|
198
|
-
disabled:
|
|
199
|
-
"aria-busy":
|
|
180
|
+
disabled: h.isPending,
|
|
181
|
+
"aria-busy": h.isPending,
|
|
200
182
|
className: "px-4 py-2 rounded-lg bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 w-full sm:w-auto",
|
|
201
|
-
children:
|
|
183
|
+
children: h.isPending ? "Creating..." : "Create"
|
|
202
184
|
}
|
|
203
185
|
)
|
|
204
186
|
] })
|
|
@@ -210,126 +192,159 @@ function me({
|
|
|
210
192
|
),
|
|
211
193
|
document.body
|
|
212
194
|
),
|
|
213
|
-
|
|
214
|
-
|
|
195
|
+
/* @__PURE__ */ e(
|
|
196
|
+
E,
|
|
215
197
|
{
|
|
216
|
-
className: "
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
-
/* @__PURE__ */ e(
|
|
198
|
+
header: /* @__PURE__ */ t("div", { className: "flex items-center justify-between gap-3 border-b bg-background px-4 py-3", children: [
|
|
199
|
+
/* @__PURE__ */ t("div", { className: "min-w-0", children: [
|
|
200
|
+
/* @__PURE__ */ e("h1", { className: "text-lg sm:text-xl font-bold text-foreground", children: "Workspaces" }),
|
|
201
|
+
/* @__PURE__ */ e("p", { className: "text-xs sm:text-sm text-muted-foreground truncate", children: "Manage your personal and organization workspaces" })
|
|
202
|
+
] }),
|
|
203
|
+
/* @__PURE__ */ t(
|
|
223
204
|
"button",
|
|
224
205
|
{
|
|
225
206
|
type: "button",
|
|
226
|
-
onClick: () =>
|
|
227
|
-
"aria-label": "
|
|
228
|
-
className: "px-
|
|
229
|
-
children:
|
|
207
|
+
onClick: () => n(!0),
|
|
208
|
+
"aria-label": "Create new organization",
|
|
209
|
+
className: "flex flex-shrink-0 items-center justify-center gap-2 px-3 py-2 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ e(I, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
212
|
+
/* @__PURE__ */ e("span", { children: "New Organization" })
|
|
213
|
+
]
|
|
230
214
|
}
|
|
231
215
|
)
|
|
232
|
-
]
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
216
|
+
] }),
|
|
217
|
+
children: /* @__PURE__ */ t("div", { className: "p-4", role: "main", "aria-label": "Workspaces", children: [
|
|
218
|
+
b && /* @__PURE__ */ t(
|
|
219
|
+
"div",
|
|
220
|
+
{
|
|
221
|
+
className: "rounded-lg border border-destructive/50 bg-destructive/10 p-4 sm:p-6 text-center mb-6 sm:mb-8",
|
|
222
|
+
role: "alert",
|
|
223
|
+
"aria-live": "polite",
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ e("p", { className: "text-destructive font-medium mb-2", children: "Failed to load workspaces" }),
|
|
226
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mb-4", children: N?.message || "An unexpected error occurred" }),
|
|
227
|
+
/* @__PURE__ */ e(
|
|
228
|
+
"button",
|
|
229
|
+
{
|
|
230
|
+
type: "button",
|
|
231
|
+
onClick: () => w(),
|
|
232
|
+
"aria-label": "Retry loading workspaces",
|
|
233
|
+
className: "px-4 py-2 rounded-lg bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
234
|
+
children: "Retry"
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
m && /* @__PURE__ */ e(H, {}),
|
|
241
|
+
!m && !b && /* @__PURE__ */ t(k, { children: [
|
|
242
|
+
y.length > 0 && /* @__PURE__ */ t(
|
|
243
|
+
"section",
|
|
244
|
+
{
|
|
245
|
+
className: "mb-6 sm:mb-8",
|
|
246
|
+
"aria-label": "Personal workspace",
|
|
247
|
+
children: [
|
|
248
|
+
/* @__PURE__ */ e("h2", { className: "text-base sm:text-lg font-semibold mb-3", children: "Personal Workspace" }),
|
|
249
|
+
/* @__PURE__ */ e(
|
|
250
|
+
D,
|
|
251
|
+
{
|
|
252
|
+
entities: y,
|
|
253
|
+
onSelect: i,
|
|
254
|
+
isLoading: m
|
|
255
|
+
}
|
|
256
|
+
)
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
),
|
|
260
|
+
/* @__PURE__ */ t("section", { "aria-label": "Organizations", children: [
|
|
261
|
+
/* @__PURE__ */ e("h2", { className: "text-base sm:text-lg font-semibold mb-3", children: "Organizations" }),
|
|
262
|
+
c.length === 0 ? /* @__PURE__ */ t(
|
|
263
|
+
"div",
|
|
259
264
|
{
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
+
className: "text-center py-6 sm:py-8 text-muted-foreground border border-dashed rounded-lg",
|
|
266
|
+
role: "status",
|
|
267
|
+
children: [
|
|
268
|
+
/* @__PURE__ */ e("p", { children: "No organizations yet" }),
|
|
269
|
+
/* @__PURE__ */ e(
|
|
270
|
+
"button",
|
|
271
|
+
{
|
|
272
|
+
type: "button",
|
|
273
|
+
onClick: () => n(!0),
|
|
274
|
+
className: "mt-2 text-primary hover:underline focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 rounded",
|
|
275
|
+
"aria-label": "Create your first organization",
|
|
276
|
+
children: "Create your first organization"
|
|
277
|
+
}
|
|
278
|
+
)
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
) : /* @__PURE__ */ e(
|
|
282
|
+
D,
|
|
283
|
+
{
|
|
284
|
+
entities: c,
|
|
285
|
+
onSelect: i,
|
|
286
|
+
isLoading: m
|
|
265
287
|
}
|
|
266
288
|
)
|
|
267
|
-
]
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
/* @__PURE__ */ e("p", { className: "text-base sm:text-lg font-medium mb-2", children: "No workspaces found" }),
|
|
285
|
-
/* @__PURE__ */ e("p", { className: "text-sm", children: "Create an organization to get started." })
|
|
286
|
-
]
|
|
287
|
-
}
|
|
288
|
-
)
|
|
289
|
-
] })
|
|
290
|
-
] }) });
|
|
289
|
+
] }),
|
|
290
|
+
u.length === 0 && /* @__PURE__ */ t(
|
|
291
|
+
"div",
|
|
292
|
+
{
|
|
293
|
+
className: "text-center py-8 sm:py-12 text-muted-foreground",
|
|
294
|
+
role: "status",
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ e("p", { className: "text-base sm:text-lg font-medium mb-2", children: "No workspaces found" }),
|
|
297
|
+
/* @__PURE__ */ e("p", { className: "text-sm", children: "Create an organization to get started." })
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
] })
|
|
302
|
+
] })
|
|
303
|
+
}
|
|
304
|
+
)
|
|
305
|
+
] });
|
|
291
306
|
}
|
|
292
|
-
function
|
|
307
|
+
function J() {
|
|
293
308
|
return /* @__PURE__ */ t("div", { className: "space-y-3", role: "status", "aria-label": "Loading members", children: [
|
|
294
|
-
[1, 2, 3].map((
|
|
309
|
+
[1, 2, 3].map((r) => /* @__PURE__ */ e(
|
|
295
310
|
"div",
|
|
296
311
|
{
|
|
297
312
|
className: "h-14 sm:h-16 rounded-lg bg-muted animate-pulse"
|
|
298
313
|
},
|
|
299
|
-
|
|
314
|
+
r
|
|
300
315
|
)),
|
|
301
316
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Loading members..." })
|
|
302
317
|
] });
|
|
303
318
|
}
|
|
304
|
-
function
|
|
305
|
-
title:
|
|
306
|
-
message:
|
|
307
|
-
confirmLabel:
|
|
308
|
-
onConfirm:
|
|
309
|
-
onCancel:
|
|
319
|
+
function Q({
|
|
320
|
+
title: r,
|
|
321
|
+
message: i,
|
|
322
|
+
confirmLabel: o,
|
|
323
|
+
onConfirm: n,
|
|
324
|
+
onCancel: s
|
|
310
325
|
}) {
|
|
311
326
|
return /* @__PURE__ */ e(
|
|
312
327
|
"div",
|
|
313
328
|
{
|
|
314
|
-
className: `fixed inset-0 z-50 flex items-center justify-center ${
|
|
329
|
+
className: `fixed inset-0 z-50 flex items-center justify-center ${R.background.overlay} p-4`,
|
|
315
330
|
role: "dialog",
|
|
316
331
|
"aria-modal": "true",
|
|
317
|
-
"aria-label":
|
|
318
|
-
onClick: (
|
|
319
|
-
|
|
332
|
+
"aria-label": r,
|
|
333
|
+
onClick: (l) => {
|
|
334
|
+
l.target === l.currentTarget && s();
|
|
320
335
|
},
|
|
321
|
-
onKeyDown: (
|
|
322
|
-
|
|
336
|
+
onKeyDown: (l) => {
|
|
337
|
+
l.key === "Escape" && s();
|
|
323
338
|
},
|
|
324
339
|
children: /* @__PURE__ */ t("div", { className: "w-full max-w-sm rounded-lg bg-background p-4 sm:p-6 shadow-lg", children: [
|
|
325
|
-
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-2", children:
|
|
326
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mb-4", children:
|
|
340
|
+
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-2", children: r }),
|
|
341
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mb-4", children: i }),
|
|
327
342
|
/* @__PURE__ */ t("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [
|
|
328
343
|
/* @__PURE__ */ e(
|
|
329
344
|
"button",
|
|
330
345
|
{
|
|
331
346
|
type: "button",
|
|
332
|
-
onClick:
|
|
347
|
+
onClick: s,
|
|
333
348
|
className: "px-4 py-2 rounded-lg border hover:bg-muted transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 w-full sm:w-auto",
|
|
334
349
|
children: "Cancel"
|
|
335
350
|
}
|
|
@@ -338,9 +353,9 @@ function re({
|
|
|
338
353
|
"button",
|
|
339
354
|
{
|
|
340
355
|
type: "button",
|
|
341
|
-
onClick:
|
|
356
|
+
onClick: n,
|
|
342
357
|
className: "px-4 py-2 rounded-lg bg-destructive text-destructive-foreground font-medium hover:bg-destructive/90 transition-colors focus:outline-none focus:ring-2 focus:ring-destructive focus:ring-offset-2 w-full sm:w-auto",
|
|
343
|
-
children:
|
|
358
|
+
children: o
|
|
344
359
|
}
|
|
345
360
|
)
|
|
346
361
|
] })
|
|
@@ -348,247 +363,208 @@ function re({
|
|
|
348
363
|
}
|
|
349
364
|
);
|
|
350
365
|
}
|
|
351
|
-
function
|
|
352
|
-
client:
|
|
353
|
-
entity:
|
|
354
|
-
currentUserId:
|
|
366
|
+
function ae({
|
|
367
|
+
client: r,
|
|
368
|
+
entity: i,
|
|
369
|
+
currentUserId: o
|
|
355
370
|
}) {
|
|
356
|
-
const
|
|
357
|
-
data:
|
|
371
|
+
const n = i.userRole === "owner", [s, l] = x(!1), [g, d] = x(null), {
|
|
372
|
+
data: u = [],
|
|
358
373
|
isLoading: m,
|
|
359
|
-
isError:
|
|
360
|
-
error:
|
|
361
|
-
refetch:
|
|
362
|
-
} =
|
|
363
|
-
data: f = [],
|
|
364
|
-
isLoading: b,
|
|
365
|
-
isError: c,
|
|
366
|
-
error: x,
|
|
367
|
-
refetch: s
|
|
368
|
-
} = J(n, r ? a.entitySlug : null), p = Q(n), D = V(n), S = async (d, h) => {
|
|
369
|
-
try {
|
|
370
|
-
await N.mutateAsync({
|
|
371
|
-
entitySlug: a.entitySlug,
|
|
372
|
-
memberId: d,
|
|
373
|
-
role: h
|
|
374
|
-
});
|
|
375
|
-
} catch (C) {
|
|
376
|
-
console.error("Failed to update role:", C);
|
|
377
|
-
}
|
|
378
|
-
}, F = (d) => {
|
|
379
|
-
const h = g.find((I) => I.id === d), C = h?.user?.displayName || h?.user?.email || "this member";
|
|
380
|
-
o({
|
|
381
|
-
type: "removeMember",
|
|
382
|
-
id: d,
|
|
383
|
-
displayLabel: C
|
|
384
|
-
});
|
|
385
|
-
}, j = async (d) => {
|
|
374
|
+
isError: b,
|
|
375
|
+
error: N,
|
|
376
|
+
refetch: w
|
|
377
|
+
} = $(r, i.entitySlug), h = W(r), y = K(r), c = Y(r), v = async (p, C) => {
|
|
386
378
|
try {
|
|
387
|
-
await
|
|
388
|
-
entitySlug:
|
|
389
|
-
memberId:
|
|
379
|
+
await h.mutateAsync({
|
|
380
|
+
entitySlug: i.entitySlug,
|
|
381
|
+
memberId: p,
|
|
382
|
+
role: C
|
|
390
383
|
});
|
|
391
|
-
} catch (
|
|
392
|
-
console.error("Failed to
|
|
384
|
+
} catch (M) {
|
|
385
|
+
console.error("Failed to update role:", M);
|
|
393
386
|
}
|
|
394
|
-
},
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
await D.mutateAsync({
|
|
409
|
-
entitySlug: a.entitySlug,
|
|
410
|
-
invitationId: d
|
|
411
|
-
});
|
|
412
|
-
} catch (h) {
|
|
413
|
-
console.error("Failed to cancel invitation:", h);
|
|
387
|
+
}, a = (p) => {
|
|
388
|
+
const C = u.find((F) => F.id === p), M = C?.user?.displayName || C?.user?.email || "this member";
|
|
389
|
+
d({ id: p, label: M });
|
|
390
|
+
}, f = async () => {
|
|
391
|
+
if (g) {
|
|
392
|
+
try {
|
|
393
|
+
await y.mutateAsync({
|
|
394
|
+
entitySlug: i.entitySlug,
|
|
395
|
+
memberId: g.id
|
|
396
|
+
});
|
|
397
|
+
} catch (p) {
|
|
398
|
+
console.error("Failed to remove member:", p);
|
|
399
|
+
}
|
|
400
|
+
d(null);
|
|
414
401
|
}
|
|
415
|
-
},
|
|
416
|
-
|
|
402
|
+
}, L = async (p) => {
|
|
403
|
+
await c.mutateAsync({
|
|
404
|
+
entitySlug: i.entitySlug,
|
|
405
|
+
request: p
|
|
406
|
+
}), l(!1);
|
|
417
407
|
};
|
|
418
|
-
return
|
|
419
|
-
|
|
408
|
+
return i.entityType === "personal" ? /* @__PURE__ */ e(
|
|
409
|
+
E,
|
|
420
410
|
{
|
|
421
|
-
className: "
|
|
422
|
-
|
|
423
|
-
"aria-label": "Personal workspace notice",
|
|
424
|
-
children: [
|
|
425
|
-
/* @__PURE__ */ e("p", { children: "Personal workspaces cannot have additional members." }),
|
|
426
|
-
/* @__PURE__ */ e("p", { className: "mt-2", children: "Create an organization to collaborate with others." })
|
|
427
|
-
]
|
|
428
|
-
}
|
|
429
|
-
) }) : /* @__PURE__ */ e("div", { className: "w-full", children: /* @__PURE__ */ t("div", { role: "main", "aria-label": "Members management", children: [
|
|
430
|
-
i && /* @__PURE__ */ e(
|
|
431
|
-
re,
|
|
432
|
-
{
|
|
433
|
-
title: i.type === "removeMember" ? "Remove Member" : "Cancel Invitation",
|
|
434
|
-
message: i.type === "removeMember" ? `Are you sure you want to remove ${i.displayLabel}? They will lose access to this organization.` : `Are you sure you want to cancel the invitation to ${i.displayLabel}?`,
|
|
435
|
-
confirmLabel: i.type === "removeMember" ? "Remove" : "Cancel Invitation",
|
|
436
|
-
onConfirm: $,
|
|
437
|
-
onCancel: () => o(null)
|
|
438
|
-
}
|
|
439
|
-
),
|
|
440
|
-
/* @__PURE__ */ t("div", { className: "mb-6 sm:mb-8", children: [
|
|
441
|
-
/* @__PURE__ */ e("h1", { className: "text-xl sm:text-2xl font-bold text-foreground", children: "Members" }),
|
|
442
|
-
/* @__PURE__ */ t("p", { className: "text-sm sm:text-base text-muted-foreground", children: [
|
|
443
|
-
"Manage members and invitations for ",
|
|
444
|
-
a.displayName
|
|
445
|
-
] })
|
|
446
|
-
] }),
|
|
447
|
-
r && /* @__PURE__ */ t(
|
|
448
|
-
"section",
|
|
449
|
-
{
|
|
450
|
-
className: "rounded-lg border p-3 sm:p-4 mb-6 sm:mb-8",
|
|
451
|
-
"aria-label": "Invite members",
|
|
452
|
-
children: [
|
|
453
|
-
/* @__PURE__ */ e("h2", { className: "text-base sm:text-lg font-semibold mb-3 sm:mb-4", children: "Invite Members" }),
|
|
454
|
-
/* @__PURE__ */ e(
|
|
455
|
-
K,
|
|
456
|
-
{
|
|
457
|
-
onSubmit: P,
|
|
458
|
-
isSubmitting: p.isPending
|
|
459
|
-
}
|
|
460
|
-
)
|
|
461
|
-
]
|
|
462
|
-
}
|
|
463
|
-
),
|
|
464
|
-
r && /* @__PURE__ */ t("section", { className: "mb-6 sm:mb-8", "aria-label": "Pending invitations", children: [
|
|
465
|
-
/* @__PURE__ */ e("h2", { className: "text-base sm:text-lg font-semibold mb-3", children: "Pending Invitations" }),
|
|
466
|
-
c ? /* @__PURE__ */ t(
|
|
411
|
+
header: /* @__PURE__ */ e("div", { className: "border-b bg-background px-4 py-3", children: /* @__PURE__ */ e("h1", { className: "text-lg sm:text-xl font-bold text-foreground", children: "Members" }) }),
|
|
412
|
+
children: /* @__PURE__ */ t(
|
|
467
413
|
"div",
|
|
468
414
|
{
|
|
469
|
-
className: "
|
|
470
|
-
role: "
|
|
471
|
-
"aria-
|
|
415
|
+
className: "p-4 text-center py-8 sm:py-12 text-muted-foreground",
|
|
416
|
+
role: "status",
|
|
417
|
+
"aria-label": "Personal workspace notice",
|
|
472
418
|
children: [
|
|
473
|
-
/* @__PURE__ */ e("p", {
|
|
474
|
-
/* @__PURE__ */ e("p", { className: "
|
|
475
|
-
/* @__PURE__ */ e(
|
|
476
|
-
"button",
|
|
477
|
-
{
|
|
478
|
-
type: "button",
|
|
479
|
-
onClick: () => s(),
|
|
480
|
-
"aria-label": "Retry loading invitations",
|
|
481
|
-
className: "px-3 py-1.5 text-sm rounded-lg bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
482
|
-
children: "Retry"
|
|
483
|
-
}
|
|
484
|
-
)
|
|
419
|
+
/* @__PURE__ */ e("p", { children: "Personal workspaces cannot have additional members." }),
|
|
420
|
+
/* @__PURE__ */ e("p", { className: "mt-2", children: "Create an organization to collaborate with others." })
|
|
485
421
|
]
|
|
486
422
|
}
|
|
487
|
-
)
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
children: [
|
|
518
|
-
/* @__PURE__ */ e("p", { className: "text-destructive font-medium mb-2", children: "Failed to load members" }),
|
|
519
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mb-3", children: u?.message || "An unexpected error occurred" }),
|
|
520
|
-
/* @__PURE__ */ e(
|
|
423
|
+
)
|
|
424
|
+
}
|
|
425
|
+
) : /* @__PURE__ */ t(k, { children: [
|
|
426
|
+
g && /* @__PURE__ */ e(
|
|
427
|
+
Q,
|
|
428
|
+
{
|
|
429
|
+
title: "Remove Member",
|
|
430
|
+
message: `Are you sure you want to remove ${g.label}? They will lose access to this organization.`,
|
|
431
|
+
confirmLabel: "Remove",
|
|
432
|
+
onConfirm: f,
|
|
433
|
+
onCancel: () => d(null)
|
|
434
|
+
}
|
|
435
|
+
),
|
|
436
|
+
/* @__PURE__ */ e(
|
|
437
|
+
E,
|
|
438
|
+
{
|
|
439
|
+
header: /* @__PURE__ */ t("div", { className: "border-b bg-background", children: [
|
|
440
|
+
/* @__PURE__ */ t("div", { className: "flex items-center justify-between gap-3 px-4 py-3", children: [
|
|
441
|
+
/* @__PURE__ */ t("div", { className: "min-w-0", children: [
|
|
442
|
+
/* @__PURE__ */ e("h1", { className: "text-lg sm:text-xl font-bold text-foreground", children: "Members" }),
|
|
443
|
+
/* @__PURE__ */ t("p", { className: "text-xs sm:text-sm text-muted-foreground truncate", children: [
|
|
444
|
+
u.length,
|
|
445
|
+
" member",
|
|
446
|
+
u.length === 1 ? "" : "s",
|
|
447
|
+
" in",
|
|
448
|
+
" ",
|
|
449
|
+
i.displayName
|
|
450
|
+
] })
|
|
451
|
+
] }),
|
|
452
|
+
n && /* @__PURE__ */ t(
|
|
521
453
|
"button",
|
|
522
454
|
{
|
|
523
455
|
type: "button",
|
|
524
|
-
onClick: () =>
|
|
525
|
-
"aria-
|
|
526
|
-
|
|
527
|
-
|
|
456
|
+
onClick: () => l((p) => !p),
|
|
457
|
+
"aria-expanded": s,
|
|
458
|
+
"aria-controls": "invite-member-panel",
|
|
459
|
+
className: "flex flex-shrink-0 items-center gap-2 px-3 py-2 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
460
|
+
children: [
|
|
461
|
+
/* @__PURE__ */ e(I, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
462
|
+
/* @__PURE__ */ e("span", { children: "Invite" })
|
|
463
|
+
]
|
|
528
464
|
}
|
|
529
465
|
)
|
|
530
|
-
]
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
466
|
+
] }),
|
|
467
|
+
n && /* @__PURE__ */ e(
|
|
468
|
+
"div",
|
|
469
|
+
{
|
|
470
|
+
id: "invite-member-panel",
|
|
471
|
+
"aria-hidden": !s,
|
|
472
|
+
className: `grid transition-[grid-template-rows] duration-200 ease-out ${s ? "grid-rows-[1fr]" : "grid-rows-[0fr]"}`,
|
|
473
|
+
children: /* @__PURE__ */ e("div", { className: "overflow-hidden", children: /* @__PURE__ */ t("div", { className: "border-t px-4 py-3 sm:py-4", children: [
|
|
474
|
+
/* @__PURE__ */ e("h2", { className: "text-sm font-semibold mb-3", children: "Invite Member" }),
|
|
475
|
+
/* @__PURE__ */ e(
|
|
476
|
+
A,
|
|
477
|
+
{
|
|
478
|
+
onSubmit: L,
|
|
479
|
+
isSubmitting: c.isPending
|
|
480
|
+
}
|
|
481
|
+
)
|
|
482
|
+
] }) })
|
|
483
|
+
}
|
|
484
|
+
)
|
|
485
|
+
] }),
|
|
486
|
+
children: /* @__PURE__ */ e("div", { className: "p-4", role: "main", "aria-label": "Members", children: b ? /* @__PURE__ */ t(
|
|
487
|
+
"div",
|
|
488
|
+
{
|
|
489
|
+
className: "rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-center",
|
|
490
|
+
role: "alert",
|
|
491
|
+
"aria-live": "polite",
|
|
492
|
+
children: [
|
|
493
|
+
/* @__PURE__ */ e("p", { className: "text-destructive font-medium mb-2", children: "Failed to load members" }),
|
|
494
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mb-3", children: N?.message || "An unexpected error occurred" }),
|
|
495
|
+
/* @__PURE__ */ e(
|
|
496
|
+
"button",
|
|
497
|
+
{
|
|
498
|
+
type: "button",
|
|
499
|
+
onClick: () => w(),
|
|
500
|
+
"aria-label": "Retry loading members",
|
|
501
|
+
className: "px-3 py-1.5 text-sm rounded-lg bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
502
|
+
children: "Retry"
|
|
503
|
+
}
|
|
504
|
+
)
|
|
505
|
+
]
|
|
506
|
+
}
|
|
507
|
+
) : m ? /* @__PURE__ */ e(J, {}) : u.length === 0 ? /* @__PURE__ */ t(
|
|
508
|
+
"div",
|
|
509
|
+
{
|
|
510
|
+
className: "text-center py-8 sm:py-12 text-muted-foreground border border-dashed rounded-lg",
|
|
511
|
+
role: "status",
|
|
512
|
+
children: [
|
|
513
|
+
/* @__PURE__ */ e("p", { children: "No members yet" }),
|
|
514
|
+
n && /* @__PURE__ */ e("p", { className: "text-sm mt-1", children: "Use the Invite button to add members." })
|
|
515
|
+
]
|
|
516
|
+
}
|
|
517
|
+
) : /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ e(
|
|
518
|
+
j,
|
|
519
|
+
{
|
|
520
|
+
members: u,
|
|
521
|
+
currentUserId: o,
|
|
522
|
+
canManage: n,
|
|
523
|
+
onRoleChange: v,
|
|
524
|
+
onRemove: a,
|
|
525
|
+
isLoading: m
|
|
526
|
+
}
|
|
527
|
+
) }) })
|
|
528
|
+
}
|
|
529
|
+
)
|
|
530
|
+
] });
|
|
555
531
|
}
|
|
556
|
-
function
|
|
532
|
+
function V() {
|
|
557
533
|
return /* @__PURE__ */ t("div", { className: "space-y-3", role: "status", "aria-label": "Loading invitations", children: [
|
|
558
|
-
[1, 2].map((
|
|
534
|
+
[1, 2].map((r) => /* @__PURE__ */ e(
|
|
559
535
|
"div",
|
|
560
536
|
{
|
|
561
537
|
className: "h-16 sm:h-20 rounded-lg bg-muted animate-pulse"
|
|
562
538
|
},
|
|
563
|
-
|
|
539
|
+
r
|
|
564
540
|
)),
|
|
565
541
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Loading invitations..." })
|
|
566
542
|
] });
|
|
567
543
|
}
|
|
568
|
-
function
|
|
569
|
-
entityName:
|
|
570
|
-
onConfirm:
|
|
571
|
-
onCancel:
|
|
544
|
+
function X({
|
|
545
|
+
entityName: r,
|
|
546
|
+
onConfirm: i,
|
|
547
|
+
onCancel: o
|
|
572
548
|
}) {
|
|
573
549
|
return /* @__PURE__ */ e(
|
|
574
550
|
"div",
|
|
575
551
|
{
|
|
576
|
-
className: `fixed inset-0 z-50 flex items-center justify-center ${
|
|
552
|
+
className: `fixed inset-0 z-50 flex items-center justify-center ${R.background.overlay} p-4`,
|
|
577
553
|
role: "dialog",
|
|
578
554
|
"aria-modal": "true",
|
|
579
555
|
"aria-label": "Decline invitation",
|
|
580
|
-
onClick: (
|
|
581
|
-
|
|
556
|
+
onClick: (n) => {
|
|
557
|
+
n.target === n.currentTarget && o();
|
|
582
558
|
},
|
|
583
|
-
onKeyDown: (
|
|
584
|
-
|
|
559
|
+
onKeyDown: (n) => {
|
|
560
|
+
n.key === "Escape" && o();
|
|
585
561
|
},
|
|
586
562
|
children: /* @__PURE__ */ t("div", { className: "w-full max-w-sm rounded-lg bg-background p-4 sm:p-6 shadow-lg", children: [
|
|
587
563
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-2", children: "Decline Invitation" }),
|
|
588
564
|
/* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground mb-4", children: [
|
|
589
565
|
"Are you sure you want to decline the invitation to join",
|
|
590
566
|
" ",
|
|
591
|
-
/* @__PURE__ */ e("strong", { children:
|
|
567
|
+
/* @__PURE__ */ e("strong", { children: r }),
|
|
592
568
|
"? You will need a new invitation to join later."
|
|
593
569
|
] }),
|
|
594
570
|
/* @__PURE__ */ t("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [
|
|
@@ -596,7 +572,7 @@ function ae({
|
|
|
596
572
|
"button",
|
|
597
573
|
{
|
|
598
574
|
type: "button",
|
|
599
|
-
onClick:
|
|
575
|
+
onClick: o,
|
|
600
576
|
className: "px-4 py-2 rounded-lg border hover:bg-muted transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 w-full sm:w-auto",
|
|
601
577
|
children: "Keep"
|
|
602
578
|
}
|
|
@@ -605,7 +581,7 @@ function ae({
|
|
|
605
581
|
"button",
|
|
606
582
|
{
|
|
607
583
|
type: "button",
|
|
608
|
-
onClick:
|
|
584
|
+
onClick: i,
|
|
609
585
|
className: "px-4 py-2 rounded-lg bg-destructive text-destructive-foreground font-medium hover:bg-destructive/90 transition-colors focus:outline-none focus:ring-2 focus:ring-destructive focus:ring-offset-2 w-full sm:w-auto",
|
|
610
586
|
children: "Decline"
|
|
611
587
|
}
|
|
@@ -615,98 +591,105 @@ function ae({
|
|
|
615
591
|
}
|
|
616
592
|
);
|
|
617
593
|
}
|
|
618
|
-
function
|
|
619
|
-
client:
|
|
620
|
-
onInvitationAccepted:
|
|
594
|
+
function oe({
|
|
595
|
+
client: r,
|
|
596
|
+
onInvitationAccepted: i
|
|
621
597
|
}) {
|
|
622
598
|
const {
|
|
623
|
-
data:
|
|
624
|
-
isLoading:
|
|
625
|
-
isError:
|
|
626
|
-
error:
|
|
599
|
+
data: o = [],
|
|
600
|
+
isLoading: n,
|
|
601
|
+
isError: s,
|
|
602
|
+
error: l,
|
|
627
603
|
refetch: g
|
|
628
|
-
} =
|
|
604
|
+
} = q(r), d = U(r), u = B(r), [m, b] = x(null), N = async (c) => {
|
|
629
605
|
try {
|
|
630
|
-
await
|
|
631
|
-
} catch (
|
|
632
|
-
console.error("Failed to accept invitation:",
|
|
606
|
+
await d.mutateAsync(c), i?.();
|
|
607
|
+
} catch (v) {
|
|
608
|
+
console.error("Failed to accept invitation:", v);
|
|
633
609
|
}
|
|
634
610
|
}, w = (c) => {
|
|
635
|
-
const
|
|
636
|
-
|
|
637
|
-
},
|
|
638
|
-
if (
|
|
611
|
+
const a = o.find((f) => f.token === c)?.entity?.displayName || "this organization";
|
|
612
|
+
b({ token: c, entityName: a });
|
|
613
|
+
}, h = async () => {
|
|
614
|
+
if (m) {
|
|
639
615
|
try {
|
|
640
|
-
await
|
|
616
|
+
await u.mutateAsync(m.token);
|
|
641
617
|
} catch (c) {
|
|
642
618
|
console.error("Failed to decline invitation:", c);
|
|
643
619
|
}
|
|
644
|
-
|
|
620
|
+
b(null);
|
|
645
621
|
}
|
|
646
|
-
},
|
|
622
|
+
}, y = o.filter(
|
|
647
623
|
(c) => c.status === "pending"
|
|
648
624
|
).length;
|
|
649
|
-
return /* @__PURE__ */
|
|
650
|
-
|
|
651
|
-
|
|
625
|
+
return /* @__PURE__ */ t(k, { children: [
|
|
626
|
+
m && /* @__PURE__ */ e(
|
|
627
|
+
X,
|
|
652
628
|
{
|
|
653
|
-
entityName:
|
|
654
|
-
onConfirm:
|
|
655
|
-
onCancel: () =>
|
|
629
|
+
entityName: m.entityName,
|
|
630
|
+
onConfirm: h,
|
|
631
|
+
onCancel: () => b(null)
|
|
656
632
|
}
|
|
657
633
|
),
|
|
658
|
-
/* @__PURE__ */
|
|
659
|
-
|
|
660
|
-
/* @__PURE__ */ e("p", { className: "text-sm sm:text-base text-muted-foreground", children: b > 0 ? `You have ${b} pending invitation${b > 1 ? "s" : ""}` : "No pending invitations" })
|
|
661
|
-
] }),
|
|
662
|
-
i && /* @__PURE__ */ t(
|
|
663
|
-
"div",
|
|
634
|
+
/* @__PURE__ */ e(
|
|
635
|
+
E,
|
|
664
636
|
{
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
-
|
|
672
|
-
"button",
|
|
637
|
+
header: /* @__PURE__ */ t("div", { className: "border-b bg-background px-4 py-3", children: [
|
|
638
|
+
/* @__PURE__ */ e("h1", { className: "text-lg sm:text-xl font-bold text-foreground", children: "Invitations" }),
|
|
639
|
+
/* @__PURE__ */ e("p", { className: "text-xs sm:text-sm text-muted-foreground", children: y > 0 ? `You have ${y} pending invitation${y > 1 ? "s" : ""}` : "No pending invitations" })
|
|
640
|
+
] }),
|
|
641
|
+
children: /* @__PURE__ */ t("div", { className: "p-4", role: "main", "aria-label": "Invitations", children: [
|
|
642
|
+
s && /* @__PURE__ */ t(
|
|
643
|
+
"div",
|
|
673
644
|
{
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
"aria-
|
|
677
|
-
|
|
678
|
-
|
|
645
|
+
className: "rounded-lg border border-destructive/50 bg-destructive/10 p-4 sm:p-6 text-center",
|
|
646
|
+
role: "alert",
|
|
647
|
+
"aria-live": "polite",
|
|
648
|
+
children: [
|
|
649
|
+
/* @__PURE__ */ e("p", { className: "text-destructive font-medium mb-2", children: "Failed to load invitations" }),
|
|
650
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mb-4", children: l?.message || "An unexpected error occurred" }),
|
|
651
|
+
/* @__PURE__ */ e(
|
|
652
|
+
"button",
|
|
653
|
+
{
|
|
654
|
+
type: "button",
|
|
655
|
+
onClick: () => g(),
|
|
656
|
+
"aria-label": "Retry loading invitations",
|
|
657
|
+
className: "px-4 py-2 rounded-lg bg-primary text-primary-foreground font-medium hover:bg-primary/90 transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
658
|
+
children: "Retry"
|
|
659
|
+
}
|
|
660
|
+
)
|
|
661
|
+
]
|
|
679
662
|
}
|
|
680
|
-
)
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
/* @__PURE__ */ e("
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
663
|
+
),
|
|
664
|
+
n && /* @__PURE__ */ e(V, {}),
|
|
665
|
+
!n && !s && /* @__PURE__ */ e(k, { children: o.length === 0 ? /* @__PURE__ */ t(
|
|
666
|
+
"div",
|
|
667
|
+
{
|
|
668
|
+
className: "text-center py-8 sm:py-12 text-muted-foreground border border-dashed rounded-lg",
|
|
669
|
+
role: "status",
|
|
670
|
+
children: [
|
|
671
|
+
/* @__PURE__ */ e("p", { className: "text-base sm:text-lg font-medium mb-1", children: "No invitations" }),
|
|
672
|
+
/* @__PURE__ */ e("p", { className: "text-sm", children: "You don't have any pending invitations" })
|
|
673
|
+
]
|
|
674
|
+
}
|
|
675
|
+
) : /* @__PURE__ */ e("section", { "aria-label": "Invitation list", children: /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ e(
|
|
676
|
+
P,
|
|
677
|
+
{
|
|
678
|
+
invitations: o,
|
|
679
|
+
mode: "user",
|
|
680
|
+
onAccept: N,
|
|
681
|
+
onDecline: w,
|
|
682
|
+
isLoading: n,
|
|
683
|
+
emptyMessage: "You don't have any pending invitations"
|
|
684
|
+
}
|
|
685
|
+
) }) }) })
|
|
686
|
+
] })
|
|
704
687
|
}
|
|
705
|
-
)
|
|
706
|
-
] })
|
|
688
|
+
)
|
|
689
|
+
] });
|
|
707
690
|
}
|
|
708
691
|
export {
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
692
|
+
ie as EntityListPage,
|
|
693
|
+
oe as InvitationsPage,
|
|
694
|
+
ae as MembersManagementPage
|
|
712
695
|
};
|
|
@@ -9,6 +9,6 @@ export interface MembersManagementPageProps {
|
|
|
9
9
|
currentUserId: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* Page for managing entity members
|
|
12
|
+
* Page for managing an entity's members.
|
|
13
13
|
*/
|
|
14
14
|
export declare function MembersManagementPage({ client, entity, currentUserId, }: MembersManagementPageProps): import("react/jsx-runtime").JSX.Element;
|