@burdenoff/microfe-headshotmarketing 2026.925.1 → 2026.925.2
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/generated/wspace-operations.d.ts +209 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +226 -125
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +83988 -38349
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +6 -4
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/AccountsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/social-media/AccountsPage.js +201 -167
- package/dist/headshotmarketing/pages/social-media/AccountsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/socialConnect.d.ts +73 -0
- package/dist/headshotmarketing/pages/social-media/socialConnect.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/social-media/socialConnect.js +67 -0
- package/dist/headshotmarketing/pages/social-media/socialConnect.js.map +1 -0
- package/dist/headshotmarketing/pages/social-media/useSocialConnect.d.ts +22 -0
- package/dist/headshotmarketing/pages/social-media/useSocialConnect.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/social-media/useSocialConnect.js +90 -0
- package/dist/headshotmarketing/pages/social-media/useSocialConnect.js.map +1 -0
- package/dist/headshotmarketing/types/index.d.ts +4 -0
- package/dist/headshotmarketing/types/index.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/oauthPopup.d.ts +58 -0
- package/dist/headshotmarketing/utils/oauthPopup.d.ts.map +1 -0
- package/dist/headshotmarketing/utils/oauthPopup.js +68 -0
- package/dist/headshotmarketing/utils/oauthPopup.js.map +1 -0
- package/dist/headshotmarketing/utils/socialMapper.d.ts +2 -0
- package/dist/headshotmarketing/utils/socialMapper.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/socialMapper.js +3 -1
- package/dist/headshotmarketing/utils/socialMapper.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountsPage.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/social-media/AccountsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AccountsPage.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/social-media/AccountsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAsHnD,eAAO,MAAM,YAAY,EAAE,EAmkB1B,CAAC"}
|
|
@@ -10,26 +10,28 @@ import "../../components/index.js";
|
|
|
10
10
|
import { useHeadshotmarketingBootstrap as f } from "../../hooks/useHeadshotmarketingBootstrap.js";
|
|
11
11
|
import { toSocialAccountModel as p } from "../../utils/socialMapper.js";
|
|
12
12
|
import "../../hooks/index.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
13
|
+
import { connectableProviderFor as m } from "./socialConnect.js";
|
|
14
|
+
import { useSocialConnect as re } from "./useSocialConnect.js";
|
|
15
|
+
import { useMemo as ie, useState as h } from "react";
|
|
16
|
+
import { CheckCircle as g, Link2 as _, Loader2 as v, Plus as ae, RefreshCw as y, ShieldCheck as oe, Trash2 as se, TrendingUp as ce, Unlink as b, Users as x, XCircle as S } from "lucide-react";
|
|
17
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
18
|
+
import { EmphasisPanel as le, PagePurpose as ue } from "@burdenoff/fe-libs/ui";
|
|
17
19
|
//#region src/headshotmarketing/pages/social-media/AccountsPage.tsx
|
|
18
|
-
var
|
|
20
|
+
var E = {
|
|
19
21
|
instagram: "bg-[var(--color-accent-soft)] text-action-primary-bg",
|
|
20
22
|
facebook: "bg-status-info-bg text-status-info-text",
|
|
21
23
|
twitter: "bg-status-info-bg text-status-info-text",
|
|
22
24
|
linkedin: "bg-status-info-bg text-status-info-text",
|
|
23
25
|
youtube: "bg-status-error-bg text-status-error-text",
|
|
24
26
|
tiktok: "bg-bg-sunken text-text-secondary"
|
|
25
|
-
},
|
|
27
|
+
}, de = {
|
|
26
28
|
facebook: c.Facebook,
|
|
27
29
|
instagram: c.Instagram,
|
|
28
30
|
twitter: c.Twitter,
|
|
29
31
|
linkedin: c.Linkedin,
|
|
30
32
|
youtube: c.Youtube,
|
|
31
33
|
tiktok: c.Tiktok
|
|
32
|
-
},
|
|
34
|
+
}, D = [
|
|
33
35
|
{
|
|
34
36
|
key: "instagram",
|
|
35
37
|
label: "Instagram",
|
|
@@ -61,97 +63,104 @@ var O = {
|
|
|
61
63
|
description: "Short-form video content"
|
|
62
64
|
}
|
|
63
65
|
];
|
|
64
|
-
function
|
|
66
|
+
function O(e) {
|
|
65
67
|
return e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
66
68
|
}
|
|
67
|
-
var
|
|
69
|
+
var k = {
|
|
68
70
|
platform: "instagram",
|
|
69
71
|
accountName: "",
|
|
70
72
|
profileUrl: "",
|
|
71
73
|
followerCount: ""
|
|
72
|
-
},
|
|
73
|
-
let { data: c, loading:
|
|
74
|
-
|
|
74
|
+
}, A = () => {
|
|
75
|
+
let { data: c, loading: A, error: j, refetch: M } = f(), [N, { loading: P }] = e(), [F] = r(), [I] = n(), [L] = t(), { connect: R, connecting: z, error: B, clearError: V } = re(async () => {
|
|
76
|
+
await M();
|
|
77
|
+
}), [H, U] = h(!1), [fe, W] = h(!1), [G, K] = h(k), [q, J] = h(null), [Y, X] = h(null), Z = ie(() => (c?.headshotmarketingSocialAccounts.items ?? []).map((e) => p(e)), [c?.headshotmarketingSocialAccounts.items]), pe = Z.filter((e) => e.connected).length, me = Z.reduce((e, t) => e + t.followers, 0), he = Z.length > 0 ? Z.reduce((e, t) => e + t.engagementRate, 0) / Z.length : 0, ge = Z.reduce((e, t) => e + t.posts, 0), _e = async () => {
|
|
78
|
+
U(!0), X(null);
|
|
75
79
|
try {
|
|
76
|
-
await
|
|
80
|
+
await M();
|
|
77
81
|
} finally {
|
|
78
|
-
|
|
82
|
+
U(!1);
|
|
79
83
|
}
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
...
|
|
84
|
+
}, Q = (e) => {
|
|
85
|
+
K({
|
|
86
|
+
...k,
|
|
83
87
|
platform: e ?? "instagram"
|
|
84
|
-
}),
|
|
85
|
-
},
|
|
86
|
-
let e =
|
|
88
|
+
}), J(null), W(!0);
|
|
89
|
+
}, ve = async () => {
|
|
90
|
+
let e = G.accountName.trim();
|
|
87
91
|
if (!e) {
|
|
88
|
-
|
|
92
|
+
J("Account name is required.");
|
|
89
93
|
return;
|
|
90
94
|
}
|
|
91
|
-
let t =
|
|
95
|
+
let t = G.followerCount ? Number(G.followerCount) : void 0;
|
|
92
96
|
if (t !== void 0 && (Number.isNaN(t) || t < 0)) {
|
|
93
|
-
|
|
97
|
+
J("Follower count must be a positive number.");
|
|
94
98
|
return;
|
|
95
99
|
}
|
|
96
|
-
|
|
100
|
+
J(null);
|
|
97
101
|
let n = {
|
|
98
|
-
platform:
|
|
102
|
+
platform: de[G.platform],
|
|
99
103
|
accountName: e,
|
|
100
|
-
platformAccountId: `${
|
|
101
|
-
profileUrl:
|
|
104
|
+
platformAccountId: `${G.platform}-${O(e) || "account"}-${Date.now().toString(36)}`,
|
|
105
|
+
profileUrl: G.profileUrl.trim() || void 0,
|
|
102
106
|
followerCount: t
|
|
103
107
|
};
|
|
104
108
|
try {
|
|
105
|
-
await
|
|
109
|
+
await N({ variables: { input: n } }), await M(), W(!1), K(k);
|
|
106
110
|
} catch (e) {
|
|
107
|
-
|
|
111
|
+
J(e instanceof Error ? e.message : "Failed to add account.");
|
|
108
112
|
}
|
|
109
|
-
},
|
|
110
|
-
|
|
113
|
+
}, ye = async (e) => {
|
|
114
|
+
X(null);
|
|
111
115
|
try {
|
|
112
|
-
await
|
|
116
|
+
await F({ variables: {
|
|
113
117
|
id: e,
|
|
114
118
|
input: { status: s.Connected }
|
|
115
|
-
} }), await
|
|
119
|
+
} }), await M();
|
|
116
120
|
} catch (e) {
|
|
117
|
-
|
|
121
|
+
X(e instanceof Error ? e.message : "Failed to connect account.");
|
|
118
122
|
}
|
|
119
|
-
},
|
|
120
|
-
|
|
123
|
+
}, be = async (e) => {
|
|
124
|
+
X(null);
|
|
121
125
|
try {
|
|
122
|
-
await
|
|
126
|
+
await I({ variables: { id: e } }), await M();
|
|
123
127
|
} catch (e) {
|
|
124
|
-
|
|
128
|
+
X(e instanceof Error ? e.message : "Failed to disconnect account.");
|
|
125
129
|
}
|
|
126
|
-
},
|
|
130
|
+
}, xe = async (e, t) => {
|
|
127
131
|
if (window.confirm(`Remove ${t}? This disconnects the account and deletes its record.`)) {
|
|
128
|
-
|
|
132
|
+
X(null);
|
|
129
133
|
try {
|
|
130
|
-
await
|
|
134
|
+
await L({ variables: { id: e } }), await M();
|
|
131
135
|
} catch (e) {
|
|
132
|
-
|
|
136
|
+
X(e instanceof Error ? e.message : "Failed to remove account.");
|
|
133
137
|
}
|
|
134
138
|
}
|
|
135
|
-
},
|
|
136
|
-
|
|
139
|
+
}, $ = (e) => {
|
|
140
|
+
V();
|
|
141
|
+
let t = Z.find((t) => t.platform === e);
|
|
142
|
+
if (m(e)) {
|
|
143
|
+
R(e, t ? { existingAccountId: t.id } : {});
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
137
146
|
if (t && !t.connected) {
|
|
138
|
-
|
|
147
|
+
ye(t.id);
|
|
139
148
|
return;
|
|
140
149
|
}
|
|
141
|
-
|
|
142
|
-
},
|
|
150
|
+
Q(e);
|
|
151
|
+
}, Se = [
|
|
143
152
|
{
|
|
144
153
|
key: "displayName",
|
|
145
154
|
header: "Account",
|
|
146
|
-
render: (e) => /* @__PURE__ */
|
|
155
|
+
render: (e) => /* @__PURE__ */ T("div", {
|
|
147
156
|
className: "flex items-center gap-3",
|
|
148
|
-
children: [/* @__PURE__ */
|
|
157
|
+
children: [/* @__PURE__ */ w("div", {
|
|
149
158
|
className: "flex h-8 w-8 items-center justify-center rounded-full bg-bg-sunken text-xs font-bold text-text-primary",
|
|
150
159
|
children: e.displayName.charAt(0)
|
|
151
|
-
}), /* @__PURE__ */
|
|
160
|
+
}), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
|
|
152
161
|
className: "text-sm font-medium text-text-primary",
|
|
153
162
|
children: e.displayName
|
|
154
|
-
}), /* @__PURE__ */
|
|
163
|
+
}), /* @__PURE__ */ w("p", {
|
|
155
164
|
className: "text-xs text-text-secondary",
|
|
156
165
|
children: e.handle
|
|
157
166
|
})] })]
|
|
@@ -160,20 +169,28 @@ var M = {
|
|
|
160
169
|
{
|
|
161
170
|
key: "platform",
|
|
162
171
|
header: "Platform",
|
|
163
|
-
render: (e) => /* @__PURE__ */
|
|
164
|
-
className: i("rounded-full px-2.5 py-0.5 text-xs font-medium capitalize",
|
|
172
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
173
|
+
className: i("rounded-full px-2.5 py-0.5 text-xs font-medium capitalize", E[e.platform]),
|
|
165
174
|
children: e.platform
|
|
166
175
|
})
|
|
167
176
|
},
|
|
168
177
|
{
|
|
169
178
|
key: "connected",
|
|
170
179
|
header: "Status",
|
|
171
|
-
render: (e) => /* @__PURE__ */
|
|
180
|
+
render: (e) => /* @__PURE__ */ w("div", {
|
|
172
181
|
className: "flex items-center gap-1.5",
|
|
173
|
-
children: e.connected ? /* @__PURE__ */
|
|
174
|
-
className: "
|
|
175
|
-
|
|
176
|
-
|
|
182
|
+
children: e.connected ? /* @__PURE__ */ T(C, { children: [
|
|
183
|
+
/* @__PURE__ */ w(g, { className: "h-3.5 w-3.5 text-status-success-text" }),
|
|
184
|
+
/* @__PURE__ */ w("span", {
|
|
185
|
+
className: "text-xs text-status-success-text font-medium",
|
|
186
|
+
children: "Connected"
|
|
187
|
+
}),
|
|
188
|
+
e.integrationConnectionId && /* @__PURE__ */ T("span", {
|
|
189
|
+
className: "inline-flex items-center gap-1 rounded-full bg-status-success-bg/60 px-1.5 py-0.5 text-[10px] font-medium text-status-success-text",
|
|
190
|
+
title: "Authorized via OAuth — publishing uses the live platform API",
|
|
191
|
+
children: [/* @__PURE__ */ w(oe, { className: "h-3 w-3" }), "OAuth"]
|
|
192
|
+
})
|
|
193
|
+
] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(S, { className: "h-3.5 w-3.5 text-status-error-text" }), /* @__PURE__ */ w("span", {
|
|
177
194
|
className: "text-xs text-status-error-text font-medium",
|
|
178
195
|
children: "Disconnected"
|
|
179
196
|
})] })
|
|
@@ -183,7 +200,7 @@ var M = {
|
|
|
183
200
|
key: "followers",
|
|
184
201
|
header: "Followers",
|
|
185
202
|
sortable: !0,
|
|
186
|
-
render: (e) => /* @__PURE__ */
|
|
203
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
187
204
|
className: "text-sm text-text-primary",
|
|
188
205
|
children: a(e.followers)
|
|
189
206
|
})
|
|
@@ -192,7 +209,7 @@ var M = {
|
|
|
192
209
|
key: "engagementRate",
|
|
193
210
|
header: "Engagement",
|
|
194
211
|
sortable: !0,
|
|
195
|
-
render: (e) => /* @__PURE__ */
|
|
212
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
196
213
|
className: "text-sm text-text-primary",
|
|
197
214
|
children: o(e.engagementRate)
|
|
198
215
|
})
|
|
@@ -200,7 +217,7 @@ var M = {
|
|
|
200
217
|
{
|
|
201
218
|
key: "lastSyncedAt",
|
|
202
219
|
header: "Last Synced",
|
|
203
|
-
render: (e) => /* @__PURE__ */
|
|
220
|
+
render: (e) => /* @__PURE__ */ w("span", {
|
|
204
221
|
className: "text-xs text-text-secondary",
|
|
205
222
|
children: ee(e.lastSyncedAt, "relative")
|
|
206
223
|
})
|
|
@@ -208,177 +225,194 @@ var M = {
|
|
|
208
225
|
{
|
|
209
226
|
key: "actions",
|
|
210
227
|
header: "",
|
|
211
|
-
render: (e) =>
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
"
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
render: (e) => {
|
|
229
|
+
let t = z?.platform === e.platform, n = !!m(e.platform), r = m(e.platform)?.label ?? e.platform;
|
|
230
|
+
return /* @__PURE__ */ T("div", {
|
|
231
|
+
className: "flex flex-wrap items-center justify-end gap-2",
|
|
232
|
+
children: [e.connected ? /* @__PURE__ */ T("button", {
|
|
233
|
+
type: "button",
|
|
234
|
+
onClick: () => void be(e.id),
|
|
235
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-xs text-text-primary hover:bg-bg-sunken",
|
|
236
|
+
children: [/* @__PURE__ */ w(b, { className: "h-3.5 w-3.5" }), "Disconnect"]
|
|
237
|
+
}) : /* @__PURE__ */ T("button", {
|
|
238
|
+
type: "button",
|
|
239
|
+
onClick: () => $(e.platform),
|
|
240
|
+
disabled: t,
|
|
241
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background hover:bg-foreground/90 disabled:opacity-60",
|
|
242
|
+
children: [t ? /* @__PURE__ */ w(v, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ w(_, { className: "h-3.5 w-3.5" }), t ? "Connecting..." : n ? `Connect with ${r}` : "Connect"]
|
|
243
|
+
}), /* @__PURE__ */ T("button", {
|
|
244
|
+
type: "button",
|
|
245
|
+
onClick: () => void xe(e.id, e.displayName),
|
|
246
|
+
"aria-label": `Remove ${e.displayName}`,
|
|
247
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-status-error-border px-3 py-1.5 text-xs text-status-error-text hover:bg-status-error-bg/40",
|
|
248
|
+
children: [/* @__PURE__ */ w(se, { className: "h-3.5 w-3.5" }), "Remove"]
|
|
249
|
+
})]
|
|
250
|
+
});
|
|
251
|
+
}
|
|
231
252
|
}
|
|
232
|
-
],
|
|
233
|
-
return /* @__PURE__ */
|
|
253
|
+
], Ce = Z.map((e) => ({ ...e }));
|
|
254
|
+
return /* @__PURE__ */ T(te, {
|
|
234
255
|
title: "Connected Accounts",
|
|
235
256
|
description: "Manage your social media platform connections",
|
|
236
|
-
actions: /* @__PURE__ */
|
|
257
|
+
actions: /* @__PURE__ */ T("div", {
|
|
237
258
|
className: "flex flex-wrap items-center gap-2",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
239
|
-
onClick:
|
|
240
|
-
disabled:
|
|
241
|
-
className: i("inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken", (
|
|
242
|
-
children: [/* @__PURE__ */
|
|
243
|
-
}), /* @__PURE__ */
|
|
244
|
-
onClick: () =>
|
|
245
|
-
className: "inline-flex items-center gap-2 rounded-md
|
|
246
|
-
children: [/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ T("button", {
|
|
260
|
+
onClick: _e,
|
|
261
|
+
disabled: H || A,
|
|
262
|
+
className: i("inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken", (H || A) && "opacity-50 cursor-not-allowed"),
|
|
263
|
+
children: [/* @__PURE__ */ w(y, { className: i("h-4 w-4", (H || A) && "animate-spin") }), H ? "Syncing..." : "Sync All"]
|
|
264
|
+
}), /* @__PURE__ */ T("button", {
|
|
265
|
+
onClick: () => Q(),
|
|
266
|
+
className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
267
|
+
children: [/* @__PURE__ */ w(ae, { className: "h-4 w-4" }), "Add manually"]
|
|
247
268
|
})]
|
|
248
269
|
}),
|
|
249
270
|
children: [
|
|
250
|
-
/* @__PURE__ */ T(
|
|
251
|
-
|
|
271
|
+
/* @__PURE__ */ T(ue, { children: [
|
|
272
|
+
"Connect the social platforms you post to. Use",
|
|
273
|
+
" ",
|
|
274
|
+
/* @__PURE__ */ w("span", {
|
|
275
|
+
className: "font-medium",
|
|
276
|
+
children: "Connect with…"
|
|
277
|
+
}),
|
|
278
|
+
" to authorize an account through the platform's own sign-in — posts then publish through the live platform API. Manual entries let you track accounts you haven't authorized yet."
|
|
279
|
+
] }),
|
|
280
|
+
/* @__PURE__ */ w(le, { children: /* @__PURE__ */ T("div", {
|
|
252
281
|
className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
|
|
253
282
|
children: [
|
|
254
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ w(l, {
|
|
255
284
|
title: "Connected",
|
|
256
|
-
value: `${
|
|
257
|
-
icon: /* @__PURE__ */
|
|
285
|
+
value: `${pe}/${D.length}`,
|
|
286
|
+
icon: /* @__PURE__ */ w(_, { className: "h-4 w-4" })
|
|
258
287
|
}),
|
|
259
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ w(l, {
|
|
260
289
|
title: "Total Followers",
|
|
261
|
-
value: a(
|
|
290
|
+
value: a(me),
|
|
262
291
|
change: 8.4,
|
|
263
|
-
icon: /* @__PURE__ */
|
|
292
|
+
icon: /* @__PURE__ */ w(x, { className: "h-4 w-4" })
|
|
264
293
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ w(l, {
|
|
266
295
|
title: "Avg Engagement",
|
|
267
|
-
value: o(
|
|
296
|
+
value: o(he),
|
|
268
297
|
change: 1.2,
|
|
269
|
-
icon: /* @__PURE__ */
|
|
298
|
+
icon: /* @__PURE__ */ w(ce, { className: "h-4 w-4" })
|
|
270
299
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ w(l, {
|
|
272
301
|
title: "Total Posts",
|
|
273
|
-
value: a(
|
|
302
|
+
value: a(ge),
|
|
274
303
|
change: 5.3
|
|
275
304
|
})
|
|
276
305
|
]
|
|
277
306
|
}) }),
|
|
278
|
-
|
|
307
|
+
B && /* @__PURE__ */ w("div", {
|
|
308
|
+
className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
|
|
309
|
+
children: B
|
|
310
|
+
}),
|
|
311
|
+
Y && /* @__PURE__ */ w("div", {
|
|
279
312
|
className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
|
|
280
|
-
children:
|
|
313
|
+
children: Y
|
|
281
314
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
loading:
|
|
284
|
-
error:
|
|
285
|
-
onRetry:
|
|
315
|
+
/* @__PURE__ */ T(d, {
|
|
316
|
+
loading: A,
|
|
317
|
+
error: j,
|
|
318
|
+
onRetry: M,
|
|
286
319
|
hasData: !!c,
|
|
287
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ T("div", {
|
|
288
321
|
className: "rounded-lg border border-border-seam bg-gloss-card shadow-pop p-6",
|
|
289
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ w("h3", {
|
|
290
323
|
className: "text-sm font-semibold text-text-primary mb-4",
|
|
291
324
|
children: "Available Platforms"
|
|
292
|
-
}), /* @__PURE__ */
|
|
325
|
+
}), /* @__PURE__ */ w("div", {
|
|
293
326
|
className: "grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",
|
|
294
|
-
children:
|
|
295
|
-
let t =
|
|
296
|
-
return /* @__PURE__ */
|
|
327
|
+
children: D.map((e) => {
|
|
328
|
+
let t = Z.find((t) => t.platform === e.key)?.connected ?? !1, n = z?.platform === e.key, r = m(e.key);
|
|
329
|
+
return /* @__PURE__ */ T("div", {
|
|
297
330
|
className: i("rounded-lg border p-4 text-center transition-colors", t ? "border-status-success-border bg-status-success-bg/50" : "border-border-subtle bg-bg-surface hover:border-foreground/30"),
|
|
298
331
|
children: [
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
className: i("inline-block rounded-full px-2.5 py-1 text-xs font-medium capitalize mb-2",
|
|
332
|
+
/* @__PURE__ */ w("span", {
|
|
333
|
+
className: i("inline-block rounded-full px-2.5 py-1 text-xs font-medium capitalize mb-2", E[e.key]),
|
|
301
334
|
children: e.label
|
|
302
335
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ w("p", {
|
|
304
337
|
className: "text-xs text-text-secondary mb-2",
|
|
305
338
|
children: e.description
|
|
306
339
|
}),
|
|
307
340
|
t ? /* @__PURE__ */ T("span", {
|
|
308
|
-
className: "text-xs text-status-success-text font-medium",
|
|
309
|
-
children: "Connected"
|
|
341
|
+
className: "inline-flex items-center gap-1 text-xs text-status-success-text font-medium",
|
|
342
|
+
children: [/* @__PURE__ */ w(g, { className: "h-3 w-3" }), "Connected"]
|
|
310
343
|
}) : /* @__PURE__ */ T("button", {
|
|
311
344
|
type: "button",
|
|
312
|
-
onClick: () =>
|
|
313
|
-
|
|
314
|
-
|
|
345
|
+
onClick: () => $(e.key),
|
|
346
|
+
disabled: n,
|
|
347
|
+
className: "inline-flex items-center gap-1 text-xs text-text-primary font-medium underline hover:no-underline disabled:opacity-60 disabled:no-underline",
|
|
348
|
+
children: [n && /* @__PURE__ */ w(v, { className: "h-3 w-3 animate-spin" }), n ? "Connecting..." : r ? `Connect with ${r.label}` : "Add manually"]
|
|
315
349
|
})
|
|
316
350
|
]
|
|
317
351
|
}, e.key);
|
|
318
352
|
})
|
|
319
353
|
})]
|
|
320
|
-
}), /* @__PURE__ */
|
|
321
|
-
data:
|
|
322
|
-
columns:
|
|
354
|
+
}), /* @__PURE__ */ w(ne, {
|
|
355
|
+
data: Ce,
|
|
356
|
+
columns: Se,
|
|
323
357
|
searchable: !0,
|
|
324
358
|
searchPlaceholder: "Search accounts...",
|
|
325
359
|
pageSize: 10,
|
|
326
360
|
emptyMessage: "No connected accounts yet",
|
|
327
|
-
emptyDescription: "
|
|
361
|
+
emptyDescription: "Connect a social account to start posting and tracking performance."
|
|
328
362
|
})]
|
|
329
363
|
}),
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
open:
|
|
332
|
-
onClose: () =>
|
|
364
|
+
/* @__PURE__ */ w(u, {
|
|
365
|
+
open: fe,
|
|
366
|
+
onClose: () => W(!1),
|
|
333
367
|
title: "Add Social Account",
|
|
334
|
-
description: "
|
|
368
|
+
description: "Track an account manually. To publish through a platform, use “Connect with…” instead.",
|
|
335
369
|
size: "md",
|
|
336
|
-
footer: /* @__PURE__ */
|
|
370
|
+
footer: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("button", {
|
|
337
371
|
type: "button",
|
|
338
|
-
onClick: () =>
|
|
372
|
+
onClick: () => W(!1),
|
|
339
373
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
340
374
|
children: "Cancel"
|
|
341
|
-
}), /* @__PURE__ */
|
|
375
|
+
}), /* @__PURE__ */ w("button", {
|
|
342
376
|
type: "button",
|
|
343
|
-
onClick:
|
|
344
|
-
disabled:
|
|
377
|
+
onClick: ve,
|
|
378
|
+
disabled: P,
|
|
345
379
|
className: "inline-flex items-center gap-2 rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90 disabled:opacity-60",
|
|
346
|
-
children:
|
|
380
|
+
children: P ? "Adding..." : "Add Account"
|
|
347
381
|
})] }),
|
|
348
|
-
children: /* @__PURE__ */
|
|
382
|
+
children: /* @__PURE__ */ T("div", {
|
|
349
383
|
className: "space-y-4",
|
|
350
384
|
children: [
|
|
351
|
-
|
|
385
|
+
q && /* @__PURE__ */ w("div", {
|
|
352
386
|
className: "rounded-md border border-status-error-border/30 bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text",
|
|
353
|
-
children:
|
|
387
|
+
children: q
|
|
354
388
|
}),
|
|
355
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ T("label", {
|
|
356
390
|
className: "block",
|
|
357
|
-
children: [/* @__PURE__ */
|
|
391
|
+
children: [/* @__PURE__ */ w("span", {
|
|
358
392
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
359
393
|
children: "Platform"
|
|
360
|
-
}), /* @__PURE__ */
|
|
361
|
-
value:
|
|
362
|
-
onChange: (e) =>
|
|
394
|
+
}), /* @__PURE__ */ w("select", {
|
|
395
|
+
value: G.platform,
|
|
396
|
+
onChange: (e) => K((t) => ({
|
|
363
397
|
...t,
|
|
364
398
|
platform: e.target.value
|
|
365
399
|
})),
|
|
366
400
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
367
|
-
children:
|
|
401
|
+
children: D.map((e) => /* @__PURE__ */ w("option", {
|
|
368
402
|
value: e.key,
|
|
369
403
|
children: e.label
|
|
370
404
|
}, e.key))
|
|
371
405
|
})]
|
|
372
406
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ T("label", {
|
|
374
408
|
className: "block",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ w("span", {
|
|
376
410
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
377
411
|
children: "Account name"
|
|
378
|
-
}), /* @__PURE__ */
|
|
412
|
+
}), /* @__PURE__ */ w("input", {
|
|
379
413
|
type: "text",
|
|
380
|
-
value:
|
|
381
|
-
onChange: (e) =>
|
|
414
|
+
value: G.accountName,
|
|
415
|
+
onChange: (e) => K((t) => ({
|
|
382
416
|
...t,
|
|
383
417
|
accountName: e.target.value
|
|
384
418
|
})),
|
|
@@ -386,22 +420,22 @@ var M = {
|
|
|
386
420
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
387
421
|
})]
|
|
388
422
|
}),
|
|
389
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ T("label", {
|
|
390
424
|
className: "block",
|
|
391
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ T("span", {
|
|
392
426
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
393
427
|
children: [
|
|
394
428
|
"Profile URL / handle",
|
|
395
429
|
" ",
|
|
396
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ w("span", {
|
|
397
431
|
className: "text-text-secondary",
|
|
398
432
|
children: "(optional)"
|
|
399
433
|
})
|
|
400
434
|
]
|
|
401
|
-
}), /* @__PURE__ */
|
|
435
|
+
}), /* @__PURE__ */ w("input", {
|
|
402
436
|
type: "text",
|
|
403
|
-
value:
|
|
404
|
-
onChange: (e) =>
|
|
437
|
+
value: G.profileUrl,
|
|
438
|
+
onChange: (e) => K((t) => ({
|
|
405
439
|
...t,
|
|
406
440
|
profileUrl: e.target.value
|
|
407
441
|
})),
|
|
@@ -409,19 +443,19 @@ var M = {
|
|
|
409
443
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
410
444
|
})]
|
|
411
445
|
}),
|
|
412
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ T("label", {
|
|
413
447
|
className: "block",
|
|
414
|
-
children: [/* @__PURE__ */
|
|
448
|
+
children: [/* @__PURE__ */ T("span", {
|
|
415
449
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
416
|
-
children: ["Followers ", /* @__PURE__ */
|
|
450
|
+
children: ["Followers ", /* @__PURE__ */ w("span", {
|
|
417
451
|
className: "text-text-secondary",
|
|
418
452
|
children: "(optional)"
|
|
419
453
|
})]
|
|
420
|
-
}), /* @__PURE__ */
|
|
454
|
+
}), /* @__PURE__ */ w("input", {
|
|
421
455
|
type: "number",
|
|
422
456
|
min: 0,
|
|
423
|
-
value:
|
|
424
|
-
onChange: (e) =>
|
|
457
|
+
value: G.followerCount,
|
|
458
|
+
onChange: (e) => K((t) => ({
|
|
425
459
|
...t,
|
|
426
460
|
followerCount: e.target.value
|
|
427
461
|
})),
|
|
@@ -436,6 +470,6 @@ var M = {
|
|
|
436
470
|
});
|
|
437
471
|
};
|
|
438
472
|
//#endregion
|
|
439
|
-
export {
|
|
473
|
+
export { A as AccountsPage };
|
|
440
474
|
|
|
441
475
|
//# sourceMappingURL=AccountsPage.js.map
|