@burdenoff/microfe-headshotmarketing 2026.529.2 → 2026.624.1
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/headshotmarketing/components/ChartCard.js +3 -3
- package/dist/headshotmarketing/components/ChartCard.js.map +1 -1
- package/dist/headshotmarketing/components/DataTable.js +12 -12
- package/dist/headshotmarketing/components/DataTable.js.map +1 -1
- package/dist/headshotmarketing/components/EmptyState.js +3 -3
- package/dist/headshotmarketing/components/EmptyState.js.map +1 -1
- package/dist/headshotmarketing/components/FilterBar.js +4 -4
- package/dist/headshotmarketing/components/FilterBar.js.map +1 -1
- package/dist/headshotmarketing/components/Modal.js +5 -5
- package/dist/headshotmarketing/components/Modal.js.map +1 -1
- package/dist/headshotmarketing/components/PageLayout.js +2 -2
- package/dist/headshotmarketing/components/PageLayout.js.map +1 -1
- package/dist/headshotmarketing/components/StatCard.js +5 -5
- package/dist/headshotmarketing/components/StatCard.js.map +1 -1
- package/dist/headshotmarketing/pages/HomePage.js +24 -24
- package/dist/headshotmarketing/pages/HomePage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js +30 -30
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js +17 -17
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdsPage.js +14 -14
- package/dist/headshotmarketing/pages/ads/AdsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AudiencesPage.js +17 -17
- package/dist/headshotmarketing/pages/ads/AudiencesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js +65 -65
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/AdAnalyticsPage.js +13 -13
- package/dist/headshotmarketing/pages/analytics/AdAnalyticsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/AnalyticsPage.js +26 -26
- package/dist/headshotmarketing/pages/analytics/AnalyticsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/CampaignAnalyticsPage.js +7 -7
- package/dist/headshotmarketing/pages/analytics/CampaignAnalyticsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js +27 -27
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/SocialAnalyticsPage.js +7 -7
- package/dist/headshotmarketing/pages/analytics/SocialAnalyticsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/AutomationPage.js +17 -17
- package/dist/headshotmarketing/pages/automation/AutomationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/TriggersPage.js +7 -7
- package/dist/headshotmarketing/pages/automation/TriggersPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js +37 -37
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.js +16 -16
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js +46 -46
- package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js +67 -67
- package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js +19 -19
- package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js +31 -31
- package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js +56 -56
- package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/AIToolsPage.js +20 -20
- package/dist/headshotmarketing/pages/content/AIToolsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/AssetLibraryPage.js +13 -13
- package/dist/headshotmarketing/pages/content/AssetLibraryPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentAnalyticsPage.js +7 -7
- package/dist/headshotmarketing/pages/content/ContentAnalyticsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js +30 -30
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentPage.js +19 -19
- package/dist/headshotmarketing/pages/content/ContentPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/ContactsPage.js +22 -22
- package/dist/headshotmarketing/pages/crm/ContactsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CreateContactPage.js +17 -17
- package/dist/headshotmarketing/pages/crm/CreateContactPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CreateDealPage.js +16 -16
- package/dist/headshotmarketing/pages/crm/CreateDealPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CrmPage.js +22 -22
- package/dist/headshotmarketing/pages/crm/CrmPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/LeadsPage.js +10 -10
- package/dist/headshotmarketing/pages/crm/LeadsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/PipelinePage.js +30 -30
- package/dist/headshotmarketing/pages/crm/PipelinePage.js.map +1 -1
- package/dist/headshotmarketing/pages/events/CreateEventPage.js +29 -29
- package/dist/headshotmarketing/pages/events/CreateEventPage.js.map +1 -1
- package/dist/headshotmarketing/pages/events/EventsPage.js +23 -23
- package/dist/headshotmarketing/pages/events/EventsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencerCampaignsPage.js +20 -20
- package/dist/headshotmarketing/pages/influencers/InfluencerCampaignsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js +22 -22
- package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencersPage.js +20 -20
- package/dist/headshotmarketing/pages/influencers/InfluencersPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js +25 -25
- package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/seo/SeoToolsPage.js +32 -32
- package/dist/headshotmarketing/pages/seo/SeoToolsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/AccountsPage.js +13 -13
- package/dist/headshotmarketing/pages/social-media/AccountsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/ContentCalendarPage.js +29 -29
- package/dist/headshotmarketing/pages/social-media/ContentCalendarPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/PostsPage.js +26 -26
- package/dist/headshotmarketing/pages/social-media/PostsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js +30 -30
- package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js +19 -19
- package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -122,7 +122,7 @@ var C = [
|
|
|
122
122
|
description: "Create and schedule content for your social media platforms",
|
|
123
123
|
actions: /* @__PURE__ */ S("button", {
|
|
124
124
|
onClick: () => w("/social"),
|
|
125
|
-
className: "inline-flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-medium text-
|
|
125
|
+
className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
126
126
|
children: [/* @__PURE__ */ x(f, { className: "h-4 w-4" }), "Back"]
|
|
127
127
|
}),
|
|
128
128
|
children: /* @__PURE__ */ S("div", {
|
|
@@ -131,24 +131,24 @@ var C = [
|
|
|
131
131
|
className: "lg:col-span-2 space-y-6",
|
|
132
132
|
children: [
|
|
133
133
|
/* @__PURE__ */ S("div", {
|
|
134
|
-
className: "rounded-lg border border-border bg-
|
|
134
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
135
135
|
children: [/* @__PURE__ */ x("h3", {
|
|
136
|
-
className: "text-sm font-semibold text-
|
|
136
|
+
className: "text-sm font-semibold text-text-primary mb-3",
|
|
137
137
|
children: "Select Platforms"
|
|
138
138
|
}), /* @__PURE__ */ x("div", {
|
|
139
139
|
className: "flex flex-wrap gap-2",
|
|
140
140
|
children: C.map((e) => /* @__PURE__ */ S("button", {
|
|
141
141
|
onClick: () => K(e.key),
|
|
142
|
-
className: i("inline-flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium border transition-colors", k.has(e.key) ? "border-foreground bg-foreground text-background" : "border-border text-
|
|
142
|
+
className: i("inline-flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium border transition-colors", k.has(e.key) ? "border-foreground bg-foreground text-background" : "border-border-subtle text-text-secondary hover:text-text-primary hover:border-foreground/50"),
|
|
143
143
|
children: [/* @__PURE__ */ x("span", { className: i("h-2 w-2 rounded-full", e.color) }), e.label]
|
|
144
144
|
}, e.key))
|
|
145
145
|
})]
|
|
146
146
|
}),
|
|
147
147
|
/* @__PURE__ */ S("div", {
|
|
148
|
-
className: "rounded-lg border border-border bg-
|
|
148
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
149
149
|
children: [
|
|
150
150
|
/* @__PURE__ */ x("h3", {
|
|
151
|
-
className: "text-sm font-semibold text-
|
|
151
|
+
className: "text-sm font-semibold text-text-primary mb-3",
|
|
152
152
|
children: "Content"
|
|
153
153
|
}),
|
|
154
154
|
/* @__PURE__ */ x("textarea", {
|
|
@@ -156,7 +156,7 @@ var C = [
|
|
|
156
156
|
onChange: (e) => M(e.target.value),
|
|
157
157
|
placeholder: "What's on your mind? Write your post content here...",
|
|
158
158
|
rows: 6,
|
|
159
|
-
className: "w-full rounded-md border border-border bg-
|
|
159
|
+
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none"
|
|
160
160
|
}),
|
|
161
161
|
/* @__PURE__ */ S("div", {
|
|
162
162
|
className: "mt-2 flex items-center justify-between",
|
|
@@ -164,22 +164,22 @@ var C = [
|
|
|
164
164
|
className: "flex items-center gap-3",
|
|
165
165
|
children: [
|
|
166
166
|
/* @__PURE__ */ x("button", {
|
|
167
|
-
className: "rounded-md p-2 text-
|
|
167
|
+
className: "rounded-md p-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken",
|
|
168
168
|
title: "Add Image",
|
|
169
169
|
children: /* @__PURE__ */ x(h, { className: "h-4 w-4" })
|
|
170
170
|
}),
|
|
171
171
|
/* @__PURE__ */ x("button", {
|
|
172
|
-
className: "rounded-md p-2 text-
|
|
172
|
+
className: "rounded-md p-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken",
|
|
173
173
|
title: "Add Video",
|
|
174
174
|
children: /* @__PURE__ */ x(b, { className: "h-4 w-4" })
|
|
175
175
|
}),
|
|
176
176
|
/* @__PURE__ */ x("button", {
|
|
177
|
-
className: "rounded-md p-2 text-
|
|
177
|
+
className: "rounded-md p-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken",
|
|
178
178
|
title: "Add Link",
|
|
179
179
|
children: /* @__PURE__ */ x(g, { className: "h-4 w-4" })
|
|
180
180
|
}),
|
|
181
181
|
/* @__PURE__ */ x("button", {
|
|
182
|
-
className: "rounded-md p-2 text-
|
|
182
|
+
className: "rounded-md p-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken",
|
|
183
183
|
title: "Add Emoji",
|
|
184
184
|
children: /* @__PURE__ */ x(y, { className: "h-4 w-4" })
|
|
185
185
|
})
|
|
@@ -187,13 +187,13 @@ var C = [
|
|
|
187
187
|
}), /* @__PURE__ */ S("div", {
|
|
188
188
|
className: "flex items-center gap-2",
|
|
189
189
|
children: [/* @__PURE__ */ x("div", {
|
|
190
|
-
className: "h-2 w-24 rounded-full bg-
|
|
190
|
+
className: "h-2 w-24 rounded-full bg-bg-sunken overflow-hidden",
|
|
191
191
|
children: /* @__PURE__ */ x("div", {
|
|
192
192
|
className: i("h-full rounded-full transition-all", J > 90 ? "bg-red-500" : J > 70 ? "bg-yellow-500" : "bg-green-500"),
|
|
193
193
|
style: { width: `${J}%` }
|
|
194
194
|
})
|
|
195
195
|
}), /* @__PURE__ */ S("span", {
|
|
196
|
-
className: i("text-xs font-medium", j.length > q ? "text-red-500" : "text-
|
|
196
|
+
className: i("text-xs font-medium", j.length > q ? "text-red-500" : "text-text-secondary"),
|
|
197
197
|
children: [
|
|
198
198
|
j.length,
|
|
199
199
|
"/",
|
|
@@ -205,16 +205,16 @@ var C = [
|
|
|
205
205
|
]
|
|
206
206
|
}),
|
|
207
207
|
/* @__PURE__ */ S("div", {
|
|
208
|
-
className: "rounded-lg border border-border bg-
|
|
208
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
209
209
|
children: [/* @__PURE__ */ S("div", {
|
|
210
210
|
className: "flex items-center justify-between mb-3",
|
|
211
211
|
children: [/* @__PURE__ */ S("h3", {
|
|
212
|
-
className: "text-sm font-semibold text-
|
|
212
|
+
className: "text-sm font-semibold text-text-primary flex items-center gap-2",
|
|
213
213
|
children: [/* @__PURE__ */ x(p, { className: "h-4 w-4" }), "Schedule"]
|
|
214
214
|
}), /* @__PURE__ */ x("button", {
|
|
215
215
|
onClick: () => P(!N),
|
|
216
|
-
className: i("relative inline-flex h-6 w-11 items-center rounded-full transition-colors", N ? "bg-foreground" : "bg-
|
|
217
|
-
children: /* @__PURE__ */ x("span", { className: i("inline-block h-4 w-4 transform rounded-full bg-
|
|
216
|
+
className: i("relative inline-flex h-6 w-11 items-center rounded-full transition-colors", N ? "bg-foreground" : "bg-bg-sunken"),
|
|
217
|
+
children: /* @__PURE__ */ x("span", { className: i("inline-block h-4 w-4 transform rounded-full bg-bg-surface transition-transform", N ? "translate-x-6" : "translate-x-1") })
|
|
218
218
|
})]
|
|
219
219
|
}), N && /* @__PURE__ */ S("div", {
|
|
220
220
|
className: "flex items-center gap-3",
|
|
@@ -222,17 +222,17 @@ var C = [
|
|
|
222
222
|
type: "date",
|
|
223
223
|
value: F,
|
|
224
224
|
onChange: (e) => I(e.target.value),
|
|
225
|
-
className: "rounded-md border border-border bg-
|
|
225
|
+
className: "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)]"
|
|
226
226
|
}), /* @__PURE__ */ x("input", {
|
|
227
227
|
type: "time",
|
|
228
228
|
value: L,
|
|
229
229
|
onChange: (e) => R(e.target.value),
|
|
230
|
-
className: "rounded-md border border-border bg-
|
|
230
|
+
className: "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)]"
|
|
231
231
|
})]
|
|
232
232
|
})]
|
|
233
233
|
}),
|
|
234
234
|
X && /* @__PURE__ */ x("div", {
|
|
235
|
-
className: "rounded-lg border border-
|
|
235
|
+
className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
|
|
236
236
|
children: X
|
|
237
237
|
}),
|
|
238
238
|
/* @__PURE__ */ S("div", {
|
|
@@ -242,7 +242,7 @@ var C = [
|
|
|
242
242
|
await $(o.Draft);
|
|
243
243
|
},
|
|
244
244
|
disabled: D,
|
|
245
|
-
className: "inline-flex items-center gap-2 rounded-md border border-border px-4 py-2 text-sm font-medium text-
|
|
245
|
+
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 disabled:opacity-60",
|
|
246
246
|
children: [/* @__PURE__ */ x(_, { className: "h-4 w-4" }), D ? "Saving..." : "Save Draft"]
|
|
247
247
|
}), /* @__PURE__ */ S("button", {
|
|
248
248
|
onClick: async () => {
|
|
@@ -257,15 +257,15 @@ var C = [
|
|
|
257
257
|
}), /* @__PURE__ */ S("div", {
|
|
258
258
|
className: "space-y-6",
|
|
259
259
|
children: [/* @__PURE__ */ S("div", {
|
|
260
|
-
className: "rounded-lg border border-border bg-
|
|
260
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
261
261
|
children: [/* @__PURE__ */ S("h3", {
|
|
262
|
-
className: "text-sm font-semibold text-
|
|
262
|
+
className: "text-sm font-semibold text-text-primary mb-3 flex items-center gap-2",
|
|
263
263
|
children: [/* @__PURE__ */ x(m, { className: "h-4 w-4" }), "Suggested Hashtags"]
|
|
264
264
|
}), /* @__PURE__ */ x("div", {
|
|
265
265
|
className: "space-y-2",
|
|
266
266
|
children: G.map((e) => /* @__PURE__ */ S("button", {
|
|
267
267
|
onClick: () => Y(e.tag),
|
|
268
|
-
className: i("flex w-full items-center justify-between rounded-md px-3 py-2 text-sm transition-colors", j.includes(e.tag) ? "bg-
|
|
268
|
+
className: i("flex w-full items-center justify-between rounded-md px-3 py-2 text-sm transition-colors", j.includes(e.tag) ? "bg-bg-sunken text-text-primary" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
|
|
269
269
|
children: [/* @__PURE__ */ x("span", { children: e.tag }), /* @__PURE__ */ S("span", {
|
|
270
270
|
className: "text-xs",
|
|
271
271
|
children: [e.posts, " posts"]
|
|
@@ -273,19 +273,19 @@ var C = [
|
|
|
273
273
|
}, e.tag))
|
|
274
274
|
})]
|
|
275
275
|
}), /* @__PURE__ */ S("div", {
|
|
276
|
-
className: "rounded-lg border border-border bg-
|
|
276
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
277
277
|
children: [
|
|
278
278
|
/* @__PURE__ */ x("h3", {
|
|
279
|
-
className: "text-sm font-semibold text-
|
|
279
|
+
className: "text-sm font-semibold text-text-primary mb-3",
|
|
280
280
|
children: "Preview"
|
|
281
281
|
}),
|
|
282
282
|
/* @__PURE__ */ x("div", {
|
|
283
|
-
className: "rounded-md border border-border bg-
|
|
283
|
+
className: "rounded-md border border-border-subtle bg-bg-surface p-4",
|
|
284
284
|
children: j ? /* @__PURE__ */ x("p", {
|
|
285
|
-
className: "text-sm text-
|
|
285
|
+
className: "text-sm text-text-primary whitespace-pre-wrap",
|
|
286
286
|
children: j
|
|
287
287
|
}) : /* @__PURE__ */ x("p", {
|
|
288
|
-
className: "text-sm text-
|
|
288
|
+
className: "text-sm text-text-secondary italic",
|
|
289
289
|
children: "Your post preview will appear here..."
|
|
290
290
|
})
|
|
291
291
|
}),
|
|
@@ -294,7 +294,7 @@ var C = [
|
|
|
294
294
|
children: Array.from(k).map((e) => {
|
|
295
295
|
let t = C.find((t) => t.key === e);
|
|
296
296
|
return /* @__PURE__ */ S("span", {
|
|
297
|
-
className: "inline-flex items-center gap-1 rounded-full border border-border px-2 py-0.5 text-xs text-
|
|
297
|
+
className: "inline-flex items-center gap-1 rounded-full border border-border-subtle px-2 py-0.5 text-xs text-text-secondary",
|
|
298
298
|
children: [/* @__PURE__ */ x("span", { className: i("h-1.5 w-1.5 rounded-full", t?.color) }), t?.label]
|
|
299
299
|
}, e);
|
|
300
300
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SocialMediaComposePage.js","names":[],"sources":["../../../../src/headshotmarketing/pages/social-media/SocialMediaComposePage.tsx"],"sourcesContent":["import { useMemo, useState, type FC } from \"react\";\nimport {\n ArrowLeft,\n Image,\n Video,\n Link2,\n SmilePlus,\n Clock,\n Send,\n Save,\n Hash,\n} from \"lucide-react\";\nimport {\n HeadshotmarketingBootstrapDataDocument,\n useCreateHeadshotmarketingSocialPostMutation,\n useHeadshotmarketingBootstrapDataQuery,\n} from \"../../../generated/wspace-operations\";\nimport {\n HeadshotmarketingSocialPostStatus as HeadshotmarketingSocialPostStatusEnum,\n type CreateHeadshotmarketingSocialPostInput,\n} from \"../../../generated/wspace-types\";\nimport { cn } from \"../../utils/helpers\";\nimport {\n toHashtagSuggestions,\n toSocialAccountModel,\n toSocialPostModel,\n} from \"../../utils/socialMapper\";\nimport { PageLayout } from \"../../components\";\nimport { useHeadshotMarketing } from \"../../context/HeadshotMarketingContext\";\nimport type {\n SocialMediaAccount,\n SocialMediaPlatform,\n SocialMediaPost,\n} from \"../../types\";\n\nconst platforms: {\n key: SocialMediaPlatform;\n label: string;\n maxChars: number;\n color: string;\n}[] = [\n {\n key: \"instagram\",\n label: \"Instagram\",\n maxChars: 2200,\n color: \"bg-pink-500\",\n },\n { key: \"facebook\", label: \"Facebook\", maxChars: 63206, color: \"bg-blue-600\" },\n { key: \"twitter\", label: \"Twitter\", maxChars: 280, color: \"bg-sky-500\" },\n {\n key: \"linkedin\",\n label: \"LinkedIn\",\n maxChars: 3000,\n color: \"bg-indigo-600\",\n },\n { key: \"youtube\", label: \"YouTube\", maxChars: 5000, color: \"bg-red-600\" },\n { key: \"tiktok\", label: \"TikTok\", maxChars: 2200, color: \"bg-gray-800\" },\n];\n\nexport const SocialMediaComposePage: FC = () => {\n const { navigate } = useHeadshotMarketing();\n const { data } = useHeadshotmarketingBootstrapDataQuery({\n variables: { limit: 200, offset: 0 },\n });\n const [createSocialPost, { loading: createLoading, error: createError }] =\n useCreateHeadshotmarketingSocialPostMutation();\n const [selectedPlatforms, setSelectedPlatforms] = useState<\n Set<SocialMediaPlatform>\n >(new Set([\"instagram\"]));\n const [content, setContent] = useState(\"\");\n const [scheduleEnabled, setScheduleEnabled] = useState(false);\n const [scheduleDate, setScheduleDate] = useState(\"\");\n const [scheduleTime, setScheduleTime] = useState(\"\");\n const [formError, setFormError] = useState<string | null>(null);\n\n const socialAccounts = useMemo<SocialMediaAccount[]>(() => {\n const items = data?.headshotmarketingSocialAccounts.items ?? [];\n return items.map((item: Parameters<typeof toSocialAccountModel>[0]) =>\n toSocialAccountModel(item),\n );\n }, [data?.headshotmarketingSocialAccounts.items]);\n\n const accountNameById = useMemo(\n () =>\n Object.fromEntries(\n (data?.headshotmarketingSocialAccounts.items ?? []).map(\n (item: { id: string; accountName: string }) => [\n item.id,\n item.accountName,\n ],\n ),\n ),\n [data?.headshotmarketingSocialAccounts.items],\n );\n\n const accountPlatformById = useMemo(\n () =>\n Object.fromEntries(\n socialAccounts.map((item) => [item.id, item.platform]),\n ),\n [socialAccounts],\n );\n\n const socialPosts = useMemo<SocialMediaPost[]>(() => {\n const items = data?.headshotmarketingSocialPosts.items ?? [];\n return items.map((item: Parameters<typeof toSocialPostModel>[0]) =>\n toSocialPostModel(item, accountNameById, accountPlatformById),\n );\n }, [\n data?.headshotmarketingSocialPosts.items,\n accountNameById,\n accountPlatformById,\n ]);\n\n const hashtags = useMemo(\n () => toHashtagSuggestions(socialPosts),\n [socialPosts],\n );\n\n const togglePlatform = (platform: SocialMediaPlatform) => {\n setSelectedPlatforms((prev) => {\n const next = new Set(prev);\n if (next.has(platform)) {\n if (next.size > 1) next.delete(platform);\n } else {\n next.add(platform);\n }\n return next;\n });\n };\n\n const minMaxChars = Math.min(\n ...Array.from(selectedPlatforms).map(\n (p) => platforms.find((pl) => pl.key === p)?.maxChars ?? 280,\n ),\n );\n\n const charPercent = Math.min((content.length / minMaxChars) * 100, 100);\n\n const addHashtag = (tag: string) => {\n if (!content.includes(tag)) {\n setContent((prev) => (prev ? `${prev} ${tag}` : tag));\n }\n };\n\n const saveError = formError ?? createError?.message ?? null;\n\n const resolveScheduledAt = (): string | null => {\n if (!scheduleEnabled) {\n return null;\n }\n const dateTime = `${scheduleDate}T${scheduleTime}`;\n const scheduledAt = new Date(dateTime);\n if (!scheduleDate || !scheduleTime || Number.isNaN(scheduledAt.getTime())) {\n return null;\n }\n return scheduledAt.toISOString();\n };\n\n const extractTags = (): string[] => {\n const matches = content.match(/#\\w+/g) ?? [];\n return Array.from(new Set(matches));\n };\n\n const createPostsForSelectedPlatforms = async (\n status: HeadshotmarketingSocialPostStatusEnum,\n ): Promise<void> => {\n const trimmedContent = content.trim();\n if (!trimmedContent) {\n setFormError(\"Post content is required.\");\n return;\n }\n\n const scheduledAt = resolveScheduledAt();\n if (scheduleEnabled && !scheduledAt) {\n setFormError(\"Provide a valid schedule date and time.\");\n return;\n }\n\n const missingPlatforms = Array.from(selectedPlatforms).filter(\n (platformKey) =>\n !socialAccounts.some((account) => account.platform === platformKey),\n );\n\n if (missingPlatforms.length > 0) {\n const labels = missingPlatforms\n .map(\n (platformKey) =>\n platforms.find((p) => p.key === platformKey)?.label ?? platformKey,\n )\n .join(\", \");\n setFormError(`Connect a social account for: ${labels}.`);\n return;\n }\n\n const tags = extractTags();\n setFormError(null);\n\n const inputs: CreateHeadshotmarketingSocialPostInput[] = Array.from(\n selectedPlatforms,\n ).map((platformKey) => {\n const socialAccountId = socialAccounts.find(\n (account) => account.platform === platformKey,\n )?.id;\n if (!socialAccountId) {\n throw new Error(`Missing social account for ${platformKey}.`);\n }\n\n return {\n socialAccountId,\n content: trimmedContent,\n status,\n scheduledAt: scheduleEnabled ? scheduledAt : null,\n tags,\n };\n });\n\n try {\n for (let index = 0; index < inputs.length; index += 1) {\n const input = inputs[index];\n const isLast = index === inputs.length - 1;\n await createSocialPost({\n variables: { input },\n refetchQueries: isLast\n ? [\n {\n query: HeadshotmarketingBootstrapDataDocument,\n variables: { limit: 200, offset: 0 },\n },\n ]\n : undefined,\n awaitRefetchQueries: isLast,\n });\n }\n\n navigate(\"/social/posts\");\n } catch (error) {\n setFormError(\n error instanceof Error\n ? error.message\n : \"Failed to create social post.\",\n );\n }\n };\n\n const handleSaveDraft = async (): Promise<void> => {\n await createPostsForSelectedPlatforms(\n HeadshotmarketingSocialPostStatusEnum.Draft,\n );\n };\n\n const handlePublishOrSchedule = async (): Promise<void> => {\n await createPostsForSelectedPlatforms(\n scheduleEnabled\n ? HeadshotmarketingSocialPostStatusEnum.Scheduled\n : HeadshotmarketingSocialPostStatusEnum.Published,\n );\n };\n\n return (\n <PageLayout\n title=\"Compose Post\"\n description=\"Create and schedule content for your social media platforms\"\n actions={\n <button\n onClick={() => navigate(\"/social\")}\n className=\"inline-flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-medium text-foreground hover:bg-muted\"\n >\n <ArrowLeft className=\"h-4 w-4\" />\n Back\n </button>\n }\n >\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Main composer */}\n <div className=\"lg:col-span-2 space-y-6\">\n {/* Platform toggles */}\n <div className=\"rounded-lg border border-border bg-card p-6\">\n <h3 className=\"text-sm font-semibold text-foreground mb-3\">\n Select Platforms\n </h3>\n <div className=\"flex flex-wrap gap-2\">\n {platforms.map((p) => (\n <button\n key={p.key}\n onClick={() => togglePlatform(p.key)}\n className={cn(\n \"inline-flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium border transition-colors\",\n selectedPlatforms.has(p.key)\n ? \"border-foreground bg-foreground text-background\"\n : \"border-border text-muted-foreground hover:text-foreground hover:border-foreground/50\",\n )}\n >\n <span className={cn(\"h-2 w-2 rounded-full\", p.color)} />\n {p.label}\n </button>\n ))}\n </div>\n </div>\n\n {/* Text area */}\n <div className=\"rounded-lg border border-border bg-card p-6\">\n <h3 className=\"text-sm font-semibold text-foreground mb-3\">\n Content\n </h3>\n <textarea\n value={content}\n onChange={(e) => setContent(e.target.value)}\n placeholder=\"What's on your mind? Write your post content here...\"\n rows={6}\n className=\"w-full rounded-md border border-border bg-background px-4 py-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-none\"\n />\n\n {/* Char counter */}\n <div className=\"mt-2 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <button\n className=\"rounded-md p-2 text-muted-foreground hover:text-foreground hover:bg-muted\"\n title=\"Add Image\"\n >\n <Image className=\"h-4 w-4\" />\n </button>\n <button\n className=\"rounded-md p-2 text-muted-foreground hover:text-foreground hover:bg-muted\"\n title=\"Add Video\"\n >\n <Video className=\"h-4 w-4\" />\n </button>\n <button\n className=\"rounded-md p-2 text-muted-foreground hover:text-foreground hover:bg-muted\"\n title=\"Add Link\"\n >\n <Link2 className=\"h-4 w-4\" />\n </button>\n <button\n className=\"rounded-md p-2 text-muted-foreground hover:text-foreground hover:bg-muted\"\n title=\"Add Emoji\"\n >\n <SmilePlus className=\"h-4 w-4\" />\n </button>\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"h-2 w-24 rounded-full bg-muted overflow-hidden\">\n <div\n className={cn(\n \"h-full rounded-full transition-all\",\n charPercent > 90\n ? \"bg-red-500\"\n : charPercent > 70\n ? \"bg-yellow-500\"\n : \"bg-green-500\",\n )}\n style={{ width: `${charPercent}%` }}\n />\n </div>\n <span\n className={cn(\n \"text-xs font-medium\",\n content.length > minMaxChars\n ? \"text-red-500\"\n : \"text-muted-foreground\",\n )}\n >\n {content.length}/{minMaxChars}\n </span>\n </div>\n </div>\n </div>\n\n {/* Schedule */}\n <div className=\"rounded-lg border border-border bg-card p-6\">\n <div className=\"flex items-center justify-between mb-3\">\n <h3 className=\"text-sm font-semibold text-foreground flex items-center gap-2\">\n <Clock className=\"h-4 w-4\" />\n Schedule\n </h3>\n <button\n onClick={() => setScheduleEnabled(!scheduleEnabled)}\n className={cn(\n \"relative inline-flex h-6 w-11 items-center rounded-full transition-colors\",\n scheduleEnabled ? \"bg-foreground\" : \"bg-muted\",\n )}\n >\n <span\n className={cn(\n \"inline-block h-4 w-4 transform rounded-full bg-background transition-transform\",\n scheduleEnabled ? \"translate-x-6\" : \"translate-x-1\",\n )}\n />\n </button>\n </div>\n {scheduleEnabled && (\n <div className=\"flex items-center gap-3\">\n <input\n type=\"date\"\n value={scheduleDate}\n onChange={(e) => setScheduleDate(e.target.value)}\n className=\"rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n <input\n type=\"time\"\n value={scheduleTime}\n onChange={(e) => setScheduleTime(e.target.value)}\n className=\"rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring\"\n />\n </div>\n )}\n </div>\n\n {/* Actions */}\n {saveError && (\n <div className=\"rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive\">\n {saveError}\n </div>\n )}\n\n <div className=\"flex items-center justify-end gap-3\">\n <button\n onClick={handleSaveDraft}\n disabled={createLoading}\n className=\"inline-flex items-center gap-2 rounded-md border border-border px-4 py-2 text-sm font-medium text-foreground hover:bg-muted disabled:opacity-60\"\n >\n <Save className=\"h-4 w-4\" />\n {createLoading ? \"Saving...\" : \"Save Draft\"}\n </button>\n <button\n onClick={handlePublishOrSchedule}\n disabled={createLoading}\n 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\"\n >\n <Send className=\"h-4 w-4\" />\n {createLoading\n ? \"Submitting...\"\n : scheduleEnabled\n ? \"Schedule Post\"\n : \"Publish Now\"}\n </button>\n </div>\n </div>\n\n {/* Sidebar - Hashtag suggestions */}\n <div className=\"space-y-6\">\n <div className=\"rounded-lg border border-border bg-card p-6\">\n <h3 className=\"text-sm font-semibold text-foreground mb-3 flex items-center gap-2\">\n <Hash className=\"h-4 w-4\" />\n Suggested Hashtags\n </h3>\n <div className=\"space-y-2\">\n {hashtags.map((h) => (\n <button\n key={h.tag}\n onClick={() => addHashtag(h.tag)}\n className={cn(\n \"flex w-full items-center justify-between rounded-md px-3 py-2 text-sm transition-colors\",\n content.includes(h.tag)\n ? \"bg-muted text-foreground\"\n : \"text-muted-foreground hover:bg-muted hover:text-foreground\",\n )}\n >\n <span>{h.tag}</span>\n <span className=\"text-xs\">{h.posts} posts</span>\n </button>\n ))}\n </div>\n </div>\n\n {/* Preview */}\n <div className=\"rounded-lg border border-border bg-card p-6\">\n <h3 className=\"text-sm font-semibold text-foreground mb-3\">\n Preview\n </h3>\n <div className=\"rounded-md border border-border bg-background p-4\">\n {content ? (\n <p className=\"text-sm text-foreground whitespace-pre-wrap\">\n {content}\n </p>\n ) : (\n <p className=\"text-sm text-muted-foreground italic\">\n Your post preview will appear here...\n </p>\n )}\n </div>\n <div className=\"mt-3 flex flex-wrap gap-1\">\n {Array.from(selectedPlatforms).map((p) => {\n const platform = platforms.find((pl) => pl.key === p);\n return (\n <span\n key={p}\n className=\"inline-flex items-center gap-1 rounded-full border border-border px-2 py-0.5 text-xs text-muted-foreground\"\n >\n <span\n className={cn(\n \"h-1.5 w-1.5 rounded-full\",\n platform?.color,\n )}\n />\n {platform?.label}\n </span>\n );\n })}\n </div>\n </div>\n </div>\n </div>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;AAmCA,IAAM,IAKA;CACJ;EACE,KAAK;EACL,OAAO;EACP,UAAU;EACV,OAAO;EACR;CACD;EAAE,KAAK;EAAY,OAAO;EAAY,UAAU;EAAO,OAAO;EAAe;CAC7E;EAAE,KAAK;EAAW,OAAO;EAAW,UAAU;EAAK,OAAO;EAAc;CACxE;EACE,KAAK;EACL,OAAO;EACP,UAAU;EACV,OAAO;EACR;CACD;EAAE,KAAK;EAAW,OAAO;EAAW,UAAU;EAAM,OAAO;EAAc;CACzE;EAAE,KAAK;EAAU,OAAO;EAAU,UAAU;EAAM,OAAO;EAAe;CACzE,EAEY,UAAmC;CAC9C,IAAM,EAAE,gBAAa,GAAsB,EACrC,EAAE,YAAS,EAAuC,EACtD,WAAW;EAAE,OAAO;EAAK,QAAQ;EAAG,EACrC,CAAC,EACI,CAAC,GAAkB,EAAE,SAAS,GAAe,OAAO,OACxD,GAA8C,EAC1C,CAAC,GAAmB,KAAwB,EAEhD,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,EACnB,CAAC,GAAS,KAAc,EAAS,GAAG,EACpC,CAAC,GAAiB,KAAsB,EAAS,GAAM,EACvD,CAAC,GAAc,KAAmB,EAAS,GAAG,EAC9C,CAAC,GAAc,KAAmB,EAAS,GAAG,EAC9C,CAAC,GAAW,KAAgB,EAAwB,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AD;SAEE,WAAU;mBAFZ,CAIE,kBAAC,QAAD,EACE,WAAW,EACT,4BACA,GAAU,MACX,EACD,CAAA,EACD,GAAU,MACN;WAVA,EAUA;SAET;OACE,CAAA;MACF;OACF;MACF;;EACK,CAAA"}
|
|
1
|
+
{"version":3,"file":"SocialMediaComposePage.js","names":[],"sources":["../../../../src/headshotmarketing/pages/social-media/SocialMediaComposePage.tsx"],"sourcesContent":["import { useMemo, useState, type FC } from \"react\";\nimport {\n ArrowLeft,\n Image,\n Video,\n Link2,\n SmilePlus,\n Clock,\n Send,\n Save,\n Hash,\n} from \"lucide-react\";\nimport {\n HeadshotmarketingBootstrapDataDocument,\n useCreateHeadshotmarketingSocialPostMutation,\n useHeadshotmarketingBootstrapDataQuery,\n} from \"../../../generated/wspace-operations\";\nimport {\n HeadshotmarketingSocialPostStatus as HeadshotmarketingSocialPostStatusEnum,\n type CreateHeadshotmarketingSocialPostInput,\n} from \"../../../generated/wspace-types\";\nimport { cn } from \"../../utils/helpers\";\nimport {\n toHashtagSuggestions,\n toSocialAccountModel,\n toSocialPostModel,\n} from \"../../utils/socialMapper\";\nimport { PageLayout } from \"../../components\";\nimport { useHeadshotMarketing } from \"../../context/HeadshotMarketingContext\";\nimport type {\n SocialMediaAccount,\n SocialMediaPlatform,\n SocialMediaPost,\n} from \"../../types\";\n\nconst platforms: {\n key: SocialMediaPlatform;\n label: string;\n maxChars: number;\n color: string;\n}[] = [\n {\n key: \"instagram\",\n label: \"Instagram\",\n maxChars: 2200,\n color: \"bg-pink-500\",\n },\n { key: \"facebook\", label: \"Facebook\", maxChars: 63206, color: \"bg-blue-600\" },\n { key: \"twitter\", label: \"Twitter\", maxChars: 280, color: \"bg-sky-500\" },\n {\n key: \"linkedin\",\n label: \"LinkedIn\",\n maxChars: 3000,\n color: \"bg-indigo-600\",\n },\n { key: \"youtube\", label: \"YouTube\", maxChars: 5000, color: \"bg-red-600\" },\n { key: \"tiktok\", label: \"TikTok\", maxChars: 2200, color: \"bg-gray-800\" },\n];\n\nexport const SocialMediaComposePage: FC = () => {\n const { navigate } = useHeadshotMarketing();\n const { data } = useHeadshotmarketingBootstrapDataQuery({\n variables: { limit: 200, offset: 0 },\n });\n const [createSocialPost, { loading: createLoading, error: createError }] =\n useCreateHeadshotmarketingSocialPostMutation();\n const [selectedPlatforms, setSelectedPlatforms] = useState<\n Set<SocialMediaPlatform>\n >(new Set([\"instagram\"]));\n const [content, setContent] = useState(\"\");\n const [scheduleEnabled, setScheduleEnabled] = useState(false);\n const [scheduleDate, setScheduleDate] = useState(\"\");\n const [scheduleTime, setScheduleTime] = useState(\"\");\n const [formError, setFormError] = useState<string | null>(null);\n\n const socialAccounts = useMemo<SocialMediaAccount[]>(() => {\n const items = data?.headshotmarketingSocialAccounts.items ?? [];\n return items.map((item: Parameters<typeof toSocialAccountModel>[0]) =>\n toSocialAccountModel(item),\n );\n }, [data?.headshotmarketingSocialAccounts.items]);\n\n const accountNameById = useMemo(\n () =>\n Object.fromEntries(\n (data?.headshotmarketingSocialAccounts.items ?? []).map(\n (item: { id: string; accountName: string }) => [\n item.id,\n item.accountName,\n ],\n ),\n ),\n [data?.headshotmarketingSocialAccounts.items],\n );\n\n const accountPlatformById = useMemo(\n () =>\n Object.fromEntries(\n socialAccounts.map((item) => [item.id, item.platform]),\n ),\n [socialAccounts],\n );\n\n const socialPosts = useMemo<SocialMediaPost[]>(() => {\n const items = data?.headshotmarketingSocialPosts.items ?? [];\n return items.map((item: Parameters<typeof toSocialPostModel>[0]) =>\n toSocialPostModel(item, accountNameById, accountPlatformById),\n );\n }, [\n data?.headshotmarketingSocialPosts.items,\n accountNameById,\n accountPlatformById,\n ]);\n\n const hashtags = useMemo(\n () => toHashtagSuggestions(socialPosts),\n [socialPosts],\n );\n\n const togglePlatform = (platform: SocialMediaPlatform) => {\n setSelectedPlatforms((prev) => {\n const next = new Set(prev);\n if (next.has(platform)) {\n if (next.size > 1) next.delete(platform);\n } else {\n next.add(platform);\n }\n return next;\n });\n };\n\n const minMaxChars = Math.min(\n ...Array.from(selectedPlatforms).map(\n (p) => platforms.find((pl) => pl.key === p)?.maxChars ?? 280,\n ),\n );\n\n const charPercent = Math.min((content.length / minMaxChars) * 100, 100);\n\n const addHashtag = (tag: string) => {\n if (!content.includes(tag)) {\n setContent((prev) => (prev ? `${prev} ${tag}` : tag));\n }\n };\n\n const saveError = formError ?? createError?.message ?? null;\n\n const resolveScheduledAt = (): string | null => {\n if (!scheduleEnabled) {\n return null;\n }\n const dateTime = `${scheduleDate}T${scheduleTime}`;\n const scheduledAt = new Date(dateTime);\n if (!scheduleDate || !scheduleTime || Number.isNaN(scheduledAt.getTime())) {\n return null;\n }\n return scheduledAt.toISOString();\n };\n\n const extractTags = (): string[] => {\n const matches = content.match(/#\\w+/g) ?? [];\n return Array.from(new Set(matches));\n };\n\n const createPostsForSelectedPlatforms = async (\n status: HeadshotmarketingSocialPostStatusEnum,\n ): Promise<void> => {\n const trimmedContent = content.trim();\n if (!trimmedContent) {\n setFormError(\"Post content is required.\");\n return;\n }\n\n const scheduledAt = resolveScheduledAt();\n if (scheduleEnabled && !scheduledAt) {\n setFormError(\"Provide a valid schedule date and time.\");\n return;\n }\n\n const missingPlatforms = Array.from(selectedPlatforms).filter(\n (platformKey) =>\n !socialAccounts.some((account) => account.platform === platformKey),\n );\n\n if (missingPlatforms.length > 0) {\n const labels = missingPlatforms\n .map(\n (platformKey) =>\n platforms.find((p) => p.key === platformKey)?.label ?? platformKey,\n )\n .join(\", \");\n setFormError(`Connect a social account for: ${labels}.`);\n return;\n }\n\n const tags = extractTags();\n setFormError(null);\n\n const inputs: CreateHeadshotmarketingSocialPostInput[] = Array.from(\n selectedPlatforms,\n ).map((platformKey) => {\n const socialAccountId = socialAccounts.find(\n (account) => account.platform === platformKey,\n )?.id;\n if (!socialAccountId) {\n throw new Error(`Missing social account for ${platformKey}.`);\n }\n\n return {\n socialAccountId,\n content: trimmedContent,\n status,\n scheduledAt: scheduleEnabled ? scheduledAt : null,\n tags,\n };\n });\n\n try {\n for (let index = 0; index < inputs.length; index += 1) {\n const input = inputs[index];\n const isLast = index === inputs.length - 1;\n await createSocialPost({\n variables: { input },\n refetchQueries: isLast\n ? [\n {\n query: HeadshotmarketingBootstrapDataDocument,\n variables: { limit: 200, offset: 0 },\n },\n ]\n : undefined,\n awaitRefetchQueries: isLast,\n });\n }\n\n navigate(\"/social/posts\");\n } catch (error) {\n setFormError(\n error instanceof Error\n ? error.message\n : \"Failed to create social post.\",\n );\n }\n };\n\n const handleSaveDraft = async (): Promise<void> => {\n await createPostsForSelectedPlatforms(\n HeadshotmarketingSocialPostStatusEnum.Draft,\n );\n };\n\n const handlePublishOrSchedule = async (): Promise<void> => {\n await createPostsForSelectedPlatforms(\n scheduleEnabled\n ? HeadshotmarketingSocialPostStatusEnum.Scheduled\n : HeadshotmarketingSocialPostStatusEnum.Published,\n );\n };\n\n return (\n <PageLayout\n title=\"Compose Post\"\n description=\"Create and schedule content for your social media platforms\"\n actions={\n <button\n onClick={() => navigate(\"/social\")}\n className=\"inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken\"\n >\n <ArrowLeft className=\"h-4 w-4\" />\n Back\n </button>\n }\n >\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Main composer */}\n <div className=\"lg:col-span-2 space-y-6\">\n {/* Platform toggles */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h3 className=\"text-sm font-semibold text-text-primary mb-3\">\n Select Platforms\n </h3>\n <div className=\"flex flex-wrap gap-2\">\n {platforms.map((p) => (\n <button\n key={p.key}\n onClick={() => togglePlatform(p.key)}\n className={cn(\n \"inline-flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium border transition-colors\",\n selectedPlatforms.has(p.key)\n ? \"border-foreground bg-foreground text-background\"\n : \"border-border-subtle text-text-secondary hover:text-text-primary hover:border-foreground/50\",\n )}\n >\n <span className={cn(\"h-2 w-2 rounded-full\", p.color)} />\n {p.label}\n </button>\n ))}\n </div>\n </div>\n\n {/* Text area */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h3 className=\"text-sm font-semibold text-text-primary mb-3\">\n Content\n </h3>\n <textarea\n value={content}\n onChange={(e) => setContent(e.target.value)}\n placeholder=\"What's on your mind? Write your post content here...\"\n rows={6}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none\"\n />\n\n {/* Char counter */}\n <div className=\"mt-2 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <button\n className=\"rounded-md p-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken\"\n title=\"Add Image\"\n >\n <Image className=\"h-4 w-4\" />\n </button>\n <button\n className=\"rounded-md p-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken\"\n title=\"Add Video\"\n >\n <Video className=\"h-4 w-4\" />\n </button>\n <button\n className=\"rounded-md p-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken\"\n title=\"Add Link\"\n >\n <Link2 className=\"h-4 w-4\" />\n </button>\n <button\n className=\"rounded-md p-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken\"\n title=\"Add Emoji\"\n >\n <SmilePlus className=\"h-4 w-4\" />\n </button>\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"h-2 w-24 rounded-full bg-bg-sunken overflow-hidden\">\n <div\n className={cn(\n \"h-full rounded-full transition-all\",\n charPercent > 90\n ? \"bg-red-500\"\n : charPercent > 70\n ? \"bg-yellow-500\"\n : \"bg-green-500\",\n )}\n style={{ width: `${charPercent}%` }}\n />\n </div>\n <span\n className={cn(\n \"text-xs font-medium\",\n content.length > minMaxChars\n ? \"text-red-500\"\n : \"text-text-secondary\",\n )}\n >\n {content.length}/{minMaxChars}\n </span>\n </div>\n </div>\n </div>\n\n {/* Schedule */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"flex items-center justify-between mb-3\">\n <h3 className=\"text-sm font-semibold text-text-primary flex items-center gap-2\">\n <Clock className=\"h-4 w-4\" />\n Schedule\n </h3>\n <button\n onClick={() => setScheduleEnabled(!scheduleEnabled)}\n className={cn(\n \"relative inline-flex h-6 w-11 items-center rounded-full transition-colors\",\n scheduleEnabled ? \"bg-foreground\" : \"bg-bg-sunken\",\n )}\n >\n <span\n className={cn(\n \"inline-block h-4 w-4 transform rounded-full bg-bg-surface transition-transform\",\n scheduleEnabled ? \"translate-x-6\" : \"translate-x-1\",\n )}\n />\n </button>\n </div>\n {scheduleEnabled && (\n <div className=\"flex items-center gap-3\">\n <input\n type=\"date\"\n value={scheduleDate}\n onChange={(e) => setScheduleDate(e.target.value)}\n className=\"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)]\"\n />\n <input\n type=\"time\"\n value={scheduleTime}\n onChange={(e) => setScheduleTime(e.target.value)}\n className=\"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)]\"\n />\n </div>\n )}\n </div>\n\n {/* Actions */}\n {saveError && (\n <div className=\"rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text\">\n {saveError}\n </div>\n )}\n\n <div className=\"flex items-center justify-end gap-3\">\n <button\n onClick={handleSaveDraft}\n disabled={createLoading}\n 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 disabled:opacity-60\"\n >\n <Save className=\"h-4 w-4\" />\n {createLoading ? \"Saving...\" : \"Save Draft\"}\n </button>\n <button\n onClick={handlePublishOrSchedule}\n disabled={createLoading}\n 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\"\n >\n <Send className=\"h-4 w-4\" />\n {createLoading\n ? \"Submitting...\"\n : scheduleEnabled\n ? \"Schedule Post\"\n : \"Publish Now\"}\n </button>\n </div>\n </div>\n\n {/* Sidebar - Hashtag suggestions */}\n <div className=\"space-y-6\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h3 className=\"text-sm font-semibold text-text-primary mb-3 flex items-center gap-2\">\n <Hash className=\"h-4 w-4\" />\n Suggested Hashtags\n </h3>\n <div className=\"space-y-2\">\n {hashtags.map((h) => (\n <button\n key={h.tag}\n onClick={() => addHashtag(h.tag)}\n className={cn(\n \"flex w-full items-center justify-between rounded-md px-3 py-2 text-sm transition-colors\",\n content.includes(h.tag)\n ? \"bg-bg-sunken text-text-primary\"\n : \"text-text-secondary hover:bg-bg-sunken hover:text-text-primary\",\n )}\n >\n <span>{h.tag}</span>\n <span className=\"text-xs\">{h.posts} posts</span>\n </button>\n ))}\n </div>\n </div>\n\n {/* Preview */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h3 className=\"text-sm font-semibold text-text-primary mb-3\">\n Preview\n </h3>\n <div className=\"rounded-md border border-border-subtle bg-bg-surface p-4\">\n {content ? (\n <p className=\"text-sm text-text-primary whitespace-pre-wrap\">\n {content}\n </p>\n ) : (\n <p className=\"text-sm text-text-secondary italic\">\n Your post preview will appear here...\n </p>\n )}\n </div>\n <div className=\"mt-3 flex flex-wrap gap-1\">\n {Array.from(selectedPlatforms).map((p) => {\n const platform = platforms.find((pl) => pl.key === p);\n return (\n <span\n key={p}\n className=\"inline-flex items-center gap-1 rounded-full border border-border-subtle px-2 py-0.5 text-xs text-text-secondary\"\n >\n <span\n className={cn(\n \"h-1.5 w-1.5 rounded-full\",\n platform?.color,\n )}\n />\n {platform?.label}\n </span>\n );\n })}\n </div>\n </div>\n </div>\n </div>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;AAmCA,IAAM,IAKA;CACJ;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;gBAAd,CACE,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA,EAAA,qBAEzB;SACL,kBAAC,OAAD;MAAK,WAAU;gBACZ,EAAS,KAAK,MACb,kBAAC,UAAD;OAEE,eAAe,EAAW,EAAE,IAAI;OAChC,WAAW,EACT,2FACA,EAAQ,SAAS,EAAE,IAAI,GACnB,mCACA,iEACL;iBARH,CAUE,kBAAC,QAAD,EAAA,UAAO,EAAE,KAAW,CAAA,EACpB,kBAAC,QAAD;QAAM,WAAU;kBAAhB,CAA2B,EAAE,OAAM,SAAa;UACzC;SAXF,EAAE,IAWA,CACT;MACE,CAAA,CACF;QAGN,kBAAC,OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,MAAD;OAAI,WAAU;iBAA+C;OAExD,CAAA;MACL,kBAAC,OAAD;OAAK,WAAU;iBACZ,IACC,kBAAC,KAAD;QAAG,WAAU;kBACV;QACC,CAAA,GAEJ,kBAAC,KAAD;QAAG,WAAU;kBAAqC;QAE9C,CAAA;OAEF,CAAA;MACN,kBAAC,OAAD;OAAK,WAAU;iBACZ,MAAM,KAAK,EAAkB,CAAC,KAAK,MAAM;QACxC,IAAM,IAAW,EAAU,MAAM,MAAO,EAAG,QAAQ,EAAE;AACrD,eACE,kBAAC,QAAD;SAEE,WAAU;mBAFZ,CAIE,kBAAC,QAAD,EACE,WAAW,EACT,4BACA,GAAU,MACX,EACD,CAAA,EACD,GAAU,MACN;WAVA,EAUA;SAET;OACE,CAAA;MACF;OACF;MACF;;EACK,CAAA"}
|
|
@@ -99,7 +99,7 @@ var N = [
|
|
|
99
99
|
children: [/* @__PURE__ */ j(D, { className: "h-4 w-4" }), L("headshotmarketing.social.actions.composePost", "Compose Post")]
|
|
100
100
|
}), /* @__PURE__ */ M("button", {
|
|
101
101
|
onClick: () => F("/social-media/calendar"),
|
|
102
|
-
className: "inline-flex items-center gap-2 rounded-md border border-border px-4 py-2 text-sm font-medium text-
|
|
102
|
+
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",
|
|
103
103
|
children: [/* @__PURE__ */ j(C, { className: "h-4 w-4" }), L("headshotmarketing.social.actions.calendar", "Calendar")]
|
|
104
104
|
})]
|
|
105
105
|
}),
|
|
@@ -107,30 +107,30 @@ var N = [
|
|
|
107
107
|
/* @__PURE__ */ j("div", {
|
|
108
108
|
className: "flex items-center gap-3 overflow-x-auto pb-2",
|
|
109
109
|
children: U.filter((e) => e.connected).map((e) => /* @__PURE__ */ M("div", {
|
|
110
|
-
className: "flex items-center gap-2 rounded-full border border-border bg-
|
|
110
|
+
className: "flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-4 py-2 text-sm whitespace-nowrap",
|
|
111
111
|
children: [
|
|
112
112
|
/* @__PURE__ */ j("span", {
|
|
113
113
|
className: u("inline-block rounded-full px-2 py-0.5 text-xs font-medium capitalize", P[e.platform]),
|
|
114
114
|
children: e.platform
|
|
115
115
|
}),
|
|
116
116
|
/* @__PURE__ */ j("span", {
|
|
117
|
-
className: "text-
|
|
117
|
+
className: "text-text-primary font-medium",
|
|
118
118
|
children: e.handle
|
|
119
119
|
}),
|
|
120
120
|
/* @__PURE__ */ j("span", {
|
|
121
|
-
className: "text-
|
|
121
|
+
className: "text-text-secondary",
|
|
122
122
|
children: d(e.followers)
|
|
123
123
|
})
|
|
124
124
|
]
|
|
125
125
|
}, e.id))
|
|
126
126
|
}),
|
|
127
127
|
/* @__PURE__ */ j("div", {
|
|
128
|
-
className: "border-b border-border",
|
|
128
|
+
className: "border-b border-border-subtle",
|
|
129
129
|
children: /* @__PURE__ */ j("div", {
|
|
130
130
|
className: "flex gap-4",
|
|
131
131
|
children: Z.map((e) => /* @__PURE__ */ j("button", {
|
|
132
132
|
onClick: () => B(e.key),
|
|
133
|
-
className: u("px-1 py-3 text-sm font-medium border-b-2 transition-colors", z === e.key ? "border-foreground text-
|
|
133
|
+
className: u("px-1 py-3 text-sm font-medium border-b-2 transition-colors", z === e.key ? "border-foreground text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"),
|
|
134
134
|
children: e.label
|
|
135
135
|
}, e.key))
|
|
136
136
|
})
|
|
@@ -172,9 +172,9 @@ var N = [
|
|
|
172
172
|
]
|
|
173
173
|
}),
|
|
174
174
|
/* @__PURE__ */ M("div", {
|
|
175
|
-
className: "rounded-lg border border-border bg-
|
|
175
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
176
176
|
children: [/* @__PURE__ */ j("h3", {
|
|
177
|
-
className: "text-sm font-semibold text-
|
|
177
|
+
className: "text-sm font-semibold text-text-primary mb-4",
|
|
178
178
|
children: L("headshotmarketing.social.sections.platformPerformance", "Platform Performance")
|
|
179
179
|
}), /* @__PURE__ */ j("div", {
|
|
180
180
|
className: "space-y-3",
|
|
@@ -190,7 +190,7 @@ var N = [
|
|
|
190
190
|
className: "flex items-center gap-6 text-sm",
|
|
191
191
|
children: [
|
|
192
192
|
/* @__PURE__ */ M("span", {
|
|
193
|
-
className: "text-
|
|
193
|
+
className: "text-text-secondary",
|
|
194
194
|
children: [
|
|
195
195
|
d(e.followers),
|
|
196
196
|
" ",
|
|
@@ -198,7 +198,7 @@ var N = [
|
|
|
198
198
|
]
|
|
199
199
|
}),
|
|
200
200
|
/* @__PURE__ */ M("span", {
|
|
201
|
-
className: "text-
|
|
201
|
+
className: "text-text-secondary",
|
|
202
202
|
children: [
|
|
203
203
|
d(e.engagement),
|
|
204
204
|
" ",
|
|
@@ -206,7 +206,7 @@ var N = [
|
|
|
206
206
|
]
|
|
207
207
|
}),
|
|
208
208
|
/* @__PURE__ */ M("span", {
|
|
209
|
-
className: "text-
|
|
209
|
+
className: "text-text-secondary",
|
|
210
210
|
children: [
|
|
211
211
|
d(e.reach),
|
|
212
212
|
" ",
|
|
@@ -219,16 +219,16 @@ var N = [
|
|
|
219
219
|
})]
|
|
220
220
|
}),
|
|
221
221
|
/* @__PURE__ */ M("div", {
|
|
222
|
-
className: "rounded-lg border border-border bg-
|
|
222
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-6",
|
|
223
223
|
children: [/* @__PURE__ */ M("h3", {
|
|
224
|
-
className: "text-sm font-semibold text-
|
|
224
|
+
className: "text-sm font-semibold text-text-primary mb-4 flex items-center gap-2",
|
|
225
225
|
children: [/* @__PURE__ */ j(T, { className: "h-4 w-4" }), L("headshotmarketing.social.sections.trendingHashtags", "Trending Hashtags")]
|
|
226
226
|
}), /* @__PURE__ */ j("div", {
|
|
227
227
|
className: "flex flex-wrap gap-2",
|
|
228
228
|
children: J.map((e) => /* @__PURE__ */ M("span", {
|
|
229
|
-
className: "inline-flex items-center gap-1 rounded-full border border-border px-3 py-1.5 text-sm text-
|
|
229
|
+
className: "inline-flex items-center gap-1 rounded-full border border-border-subtle px-3 py-1.5 text-sm text-text-primary",
|
|
230
230
|
children: [e.tag, /* @__PURE__ */ j("span", {
|
|
231
|
-
className: "text-xs text-
|
|
231
|
+
className: "text-xs text-text-secondary",
|
|
232
232
|
children: d(e.engagement)
|
|
233
233
|
})]
|
|
234
234
|
}, e.tag))
|
|
@@ -243,7 +243,7 @@ var N = [
|
|
|
243
243
|
children: /* @__PURE__ */ M("select", {
|
|
244
244
|
value: V,
|
|
245
245
|
onChange: (e) => H(e.target.value),
|
|
246
|
-
className: "rounded-md border border-border bg-
|
|
246
|
+
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
247
247
|
children: [
|
|
248
248
|
/* @__PURE__ */ j("option", {
|
|
249
249
|
value: "all",
|
|
@@ -278,7 +278,7 @@ var N = [
|
|
|
278
278
|
}), /* @__PURE__ */ j("div", {
|
|
279
279
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
|
|
280
280
|
children: X.map((e) => /* @__PURE__ */ M("div", {
|
|
281
|
-
className: "rounded-lg border border-border bg-
|
|
281
|
+
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 space-y-3",
|
|
282
282
|
children: [
|
|
283
283
|
/* @__PURE__ */ M("div", {
|
|
284
284
|
className: "flex items-center justify-between",
|
|
@@ -288,11 +288,11 @@ var N = [
|
|
|
288
288
|
}), /* @__PURE__ */ j(h, { status: e.status })]
|
|
289
289
|
}),
|
|
290
290
|
/* @__PURE__ */ j("p", {
|
|
291
|
-
className: "text-sm text-
|
|
291
|
+
className: "text-sm text-text-primary line-clamp-3",
|
|
292
292
|
children: e.content
|
|
293
293
|
}),
|
|
294
294
|
e.status === "published" && /* @__PURE__ */ M("div", {
|
|
295
|
-
className: "flex items-center gap-4 text-xs text-
|
|
295
|
+
className: "flex items-center gap-4 text-xs text-text-secondary",
|
|
296
296
|
children: [
|
|
297
297
|
/* @__PURE__ */ M("span", { children: [
|
|
298
298
|
d(e.metrics.likes),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SocialMediaPage.js","names":[],"sources":["../../../../src/headshotmarketing/pages/social-media/SocialMediaPage.tsx"],"sourcesContent":["import { useState, useMemo, type FC } from \"react\";\nimport {\n Users,\n Eye,\n Heart,\n TrendingUp,\n PenSquare,\n CalendarDays,\n Hash,\n} from \"lucide-react\";\nimport {\n BarChart,\n Bar,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n Legend,\n} from \"recharts\";\nimport { useHeadshotmarketingBootstrapDataQuery } from \"../../../generated/wspace-operations\";\nimport { cn, formatNumber, formatPercentage } from \"../../utils/helpers\";\nimport {\n toEngagementSeries,\n toHashtagSuggestions,\n toSocialAccountModel,\n toSocialPostModel,\n} from \"../../utils/socialMapper\";\nimport { PageLayout, StatCard, StatusBadge, ChartCard } from \"../../components\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { useHeadshotMarketing } from \"../../context/HeadshotMarketingContext\";\nimport type { SocialMediaAccount, SocialMediaPost } from \"../../types\";\n\nconst CHART_COLORS = [\n \"#3b82f6\",\n \"#10b981\",\n \"#f59e0b\",\n \"#ef4444\",\n \"#8b5cf6\",\n \"#ec4899\",\n];\n\nconst platformColors: Record<string, string> = {\n instagram: \"bg-pink-100 text-pink-700\",\n facebook: \"bg-blue-100 text-blue-700\",\n twitter: \"bg-sky-100 text-sky-700\",\n linkedin: \"bg-indigo-100 text-indigo-700\",\n youtube: \"bg-red-100 text-red-700\",\n tiktok: \"bg-gray-100 text-gray-700\",\n};\n\ntype Tab = \"overview\" | \"posts\" | \"analytics\";\n\nexport const SocialMediaPage: FC = () => {\n const { navigate } = useHeadshotMarketing();\n const { t: translate } = useI18n();\n const t = (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n };\n const { data } = useHeadshotmarketingBootstrapDataQuery({\n variables: { limit: 200, offset: 0 },\n });\n const [activeTab, setActiveTab] = useState<Tab>(\"overview\");\n const [platformFilter, setPlatformFilter] = useState<string>(\"all\");\n\n const socialAccounts = useMemo<SocialMediaAccount[]>(() => {\n const items = data?.headshotmarketingSocialAccounts.items ?? [];\n return items.map((item: Parameters<typeof toSocialAccountModel>[0]) =>\n toSocialAccountModel(item),\n );\n }, [data?.headshotmarketingSocialAccounts.items]);\n\n const accountNameById = useMemo(\n () =>\n Object.fromEntries(\n (data?.headshotmarketingSocialAccounts.items ?? []).map(\n (item: { id: string; accountName: string }) => [\n item.id,\n item.accountName,\n ],\n ),\n ),\n [data?.headshotmarketingSocialAccounts.items],\n );\n\n const accountPlatformById = useMemo(\n () =>\n Object.fromEntries(\n socialAccounts.map((item) => [item.id, item.platform]),\n ),\n [socialAccounts],\n );\n\n const socialPosts = useMemo<SocialMediaPost[]>(() => {\n const items = data?.headshotmarketingSocialPosts.items ?? [];\n return items.map((item: Parameters<typeof toSocialPostModel>[0]) =>\n toSocialPostModel(item, accountNameById, accountPlatformById),\n );\n }, [\n data?.headshotmarketingSocialPosts.items,\n accountNameById,\n accountPlatformById,\n ]);\n\n const socialMetrics = useMemo(() => {\n const metrics = data?.headshotmarketingSocialMetrics;\n const totalReach = socialPosts.reduce(\n (sum: number, post: SocialMediaPost) => sum + post.metrics.reach,\n 0,\n );\n const totalImpressions = socialPosts.reduce(\n (sum: number, post: SocialMediaPost) => sum + post.metrics.impressions,\n 0,\n );\n const publishedPosts = socialPosts.filter(\n (post) => post.status === \"published\",\n );\n const averageEngagementRate =\n publishedPosts.length > 0\n ? publishedPosts.reduce(\n (sum: number, post: SocialMediaPost) =>\n sum + post.metrics.engagementRate,\n 0,\n ) / publishedPosts.length\n : 0;\n\n const platformBreakdown = Object.values(\n socialAccounts.reduce<\n Record<\n string,\n {\n platform: SocialMediaAccount[\"platform\"];\n followers: number;\n engagement: number;\n reach: number;\n }\n >\n >(\n (\n acc: Record<\n string,\n {\n platform: SocialMediaAccount[\"platform\"];\n followers: number;\n engagement: number;\n reach: number;\n }\n >,\n account: SocialMediaAccount,\n ) => {\n if (!acc[account.platform]) {\n acc[account.platform] = {\n platform: account.platform,\n followers: 0,\n engagement: 0,\n reach: 0,\n };\n }\n acc[account.platform].followers += account.followers;\n return acc;\n },\n {},\n ),\n ).map((entry) => {\n const postMetrics = socialPosts\n .filter((post) => post.platform === entry.platform)\n .reduce(\n (\n acc: { engagement: number; reach: number },\n post: SocialMediaPost,\n ) => {\n acc.engagement +=\n post.metrics.likes + post.metrics.comments + post.metrics.shares;\n acc.reach += post.metrics.reach;\n return acc;\n },\n { engagement: 0, reach: 0 },\n );\n\n return {\n ...entry,\n engagement: postMetrics.engagement,\n reach: postMetrics.reach,\n };\n });\n\n return {\n totalFollowers:\n metrics?.totalFollowers ??\n socialAccounts.reduce(\n (sum: number, account: SocialMediaAccount) => sum + account.followers,\n 0,\n ),\n totalEngagement:\n metrics?.totalEngagement ??\n socialPosts.reduce(\n (sum: number, post: SocialMediaPost) =>\n sum +\n post.metrics.likes +\n post.metrics.comments +\n post.metrics.shares,\n 0,\n ),\n totalReach,\n totalImpressions,\n averageEngagementRate,\n platformBreakdown,\n };\n }, [data?.headshotmarketingSocialMetrics, socialAccounts, socialPosts]);\n\n const hashtags = useMemo(\n () => toHashtagSuggestions(socialPosts),\n [socialPosts],\n );\n const engagementData = useMemo(\n () => toEngagementSeries(socialPosts),\n [socialPosts],\n );\n\n const filteredPosts = useMemo(() => {\n if (platformFilter === \"all\") return socialPosts;\n return socialPosts.filter(\n (p: SocialMediaPost) => p.platform === platformFilter,\n );\n }, [platformFilter, socialPosts]);\n\n const tabs: { key: Tab; label: string }[] = [\n {\n key: \"overview\",\n label: t(\"headshotmarketing.social.tabs.overview\", \"Overview\"),\n },\n { key: \"posts\", label: t(\"headshotmarketing.social.tabs.posts\", \"Posts\") },\n {\n key: \"analytics\",\n label: t(\"headshotmarketing.social.tabs.analytics\", \"Analytics\"),\n },\n ];\n\n return (\n <PageLayout\n title={t(\"headshotmarketing.social.title\", \"Social Media\")}\n description={t(\n \"headshotmarketing.social.description\",\n \"Manage and monitor your social media presence across all platforms\",\n )}\n actions={\n <div className=\"flex items-center gap-2\">\n <button\n onClick={() => navigate(\"/social-media/compose\")}\n 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\"\n >\n <PenSquare className=\"h-4 w-4\" />\n {t(\"headshotmarketing.social.actions.composePost\", \"Compose Post\")}\n </button>\n <button\n onClick={() => navigate(\"/social-media/calendar\")}\n className=\"inline-flex items-center gap-2 rounded-md border border-border px-4 py-2 text-sm font-medium text-foreground hover:bg-muted\"\n >\n <CalendarDays className=\"h-4 w-4\" />\n {t(\"headshotmarketing.social.actions.calendar\", \"Calendar\")}\n </button>\n </div>\n }\n >\n {/* Connected Accounts */}\n <div className=\"flex items-center gap-3 overflow-x-auto pb-2\">\n {socialAccounts\n .filter((a: SocialMediaAccount) => a.connected)\n .map((account) => (\n <div\n key={account.id}\n className=\"flex items-center gap-2 rounded-full border border-border bg-card px-4 py-2 text-sm whitespace-nowrap\"\n >\n <span\n className={cn(\n \"inline-block rounded-full px-2 py-0.5 text-xs font-medium capitalize\",\n platformColors[account.platform],\n )}\n >\n {account.platform}\n </span>\n <span className=\"text-foreground font-medium\">\n {account.handle}\n </span>\n <span className=\"text-muted-foreground\">\n {formatNumber(account.followers)}\n </span>\n </div>\n ))}\n </div>\n\n {/* Tabs */}\n <div className=\"border-b border-border\">\n <div className=\"flex gap-4\">\n {tabs.map((tab) => (\n <button\n key={tab.key}\n onClick={() => setActiveTab(tab.key)}\n className={cn(\n \"px-1 py-3 text-sm font-medium border-b-2 transition-colors\",\n activeTab === tab.key\n ? \"border-foreground text-foreground\"\n : \"border-transparent text-muted-foreground hover:text-foreground\",\n )}\n >\n {tab.label}\n </button>\n ))}\n </div>\n </div>\n\n {/* Overview Tab */}\n {activeTab === \"overview\" && (\n <div className=\"space-y-6\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatCard\n title={t(\n \"headshotmarketing.social.stats.totalFollowers\",\n \"Total Followers\",\n )}\n value={formatNumber(socialMetrics.totalFollowers)}\n change={8.4}\n changeLabel={t(\n \"headshotmarketing.common.vsLastMonth\",\n \"vs last month\",\n )}\n icon={<Users className=\"h-4 w-4\" />}\n />\n <StatCard\n title={t(\n \"headshotmarketing.social.stats.totalEngagement\",\n \"Total Engagement\",\n )}\n value={formatNumber(socialMetrics.totalEngagement)}\n change={12.3}\n changeLabel={t(\n \"headshotmarketing.common.vsLastMonth\",\n \"vs last month\",\n )}\n icon={<Heart className=\"h-4 w-4\" />}\n />\n <StatCard\n title={t(\n \"headshotmarketing.social.stats.totalReach\",\n \"Total Reach\",\n )}\n value={formatNumber(socialMetrics.totalReach)}\n change={5.7}\n changeLabel={t(\n \"headshotmarketing.common.vsLastMonth\",\n \"vs last month\",\n )}\n icon={<Eye className=\"h-4 w-4\" />}\n />\n <StatCard\n title={t(\n \"headshotmarketing.social.stats.avgEngagementRate\",\n \"Avg Engagement Rate\",\n )}\n value={formatPercentage(socialMetrics.averageEngagementRate)}\n change={0.8}\n changeLabel={t(\n \"headshotmarketing.common.vsLastMonth\",\n \"vs last month\",\n )}\n icon={<TrendingUp className=\"h-4 w-4\" />}\n />\n </div>\n\n {/* Platform Breakdown */}\n <div className=\"rounded-lg border border-border bg-card p-6\">\n <h3 className=\"text-sm font-semibold text-foreground mb-4\">\n {t(\n \"headshotmarketing.social.sections.platformPerformance\",\n \"Platform Performance\",\n )}\n </h3>\n <div className=\"space-y-3\">\n {socialMetrics.platformBreakdown.map(\n (platform: {\n platform: string;\n followers: number;\n engagement: number;\n reach: number;\n }) => (\n <div\n key={platform.platform}\n className=\"flex items-center justify-between\"\n >\n <div className=\"flex items-center gap-3\">\n <span\n className={cn(\n \"inline-block rounded-full px-2.5 py-0.5 text-xs font-medium capitalize\",\n platformColors[platform.platform],\n )}\n >\n {platform.platform}\n </span>\n </div>\n <div className=\"flex items-center gap-6 text-sm\">\n <span className=\"text-muted-foreground\">\n {formatNumber(platform.followers)}{\" \"}\n {t(\n \"headshotmarketing.social.metrics.followers\",\n \"followers\",\n )}\n </span>\n <span className=\"text-muted-foreground\">\n {formatNumber(platform.engagement)}{\" \"}\n {t(\n \"headshotmarketing.social.metrics.engagement\",\n \"engagement\",\n )}\n </span>\n <span className=\"text-muted-foreground\">\n {formatNumber(platform.reach)}{\" \"}\n {t(\"headshotmarketing.social.metrics.reach\", \"reach\")}\n </span>\n </div>\n </div>\n ),\n )}\n </div>\n </div>\n\n {/* Trending Hashtags */}\n <div className=\"rounded-lg border border-border bg-card p-6\">\n <h3 className=\"text-sm font-semibold text-foreground mb-4 flex items-center gap-2\">\n <Hash className=\"h-4 w-4\" />\n {t(\n \"headshotmarketing.social.sections.trendingHashtags\",\n \"Trending Hashtags\",\n )}\n </h3>\n <div className=\"flex flex-wrap gap-2\">\n {hashtags.map((h) => (\n <span\n key={h.tag}\n className=\"inline-flex items-center gap-1 rounded-full border border-border px-3 py-1.5 text-sm text-foreground\"\n >\n {h.tag}\n <span className=\"text-xs text-muted-foreground\">\n {formatNumber(h.engagement)}\n </span>\n </span>\n ))}\n </div>\n </div>\n </div>\n )}\n\n {/* Posts Tab */}\n {activeTab === \"posts\" && (\n <div className=\"space-y-4\">\n <div className=\"flex items-center gap-2\">\n <select\n value={platformFilter}\n onChange={(e) => setPlatformFilter(e.target.value)}\n className=\"rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground\"\n >\n <option value=\"all\">\n {t(\n \"headshotmarketing.social.filters.allPlatforms\",\n \"All Platforms\",\n )}\n </option>\n <option value=\"instagram\">Instagram</option>\n <option value=\"facebook\">Facebook</option>\n <option value=\"twitter\">Twitter</option>\n <option value=\"linkedin\">LinkedIn</option>\n <option value=\"youtube\">YouTube</option>\n <option value=\"tiktok\">TikTok</option>\n </select>\n </div>\n\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3\">\n {filteredPosts.map((post: SocialMediaPost) => (\n <div\n key={post.id}\n className=\"rounded-lg border border-border bg-card p-4 space-y-3\"\n >\n <div className=\"flex items-center justify-between\">\n <span\n className={cn(\n \"rounded-full px-2.5 py-0.5 text-xs font-medium capitalize\",\n platformColors[post.platform],\n )}\n >\n {post.platform}\n </span>\n <StatusBadge status={post.status} />\n </div>\n <p className=\"text-sm text-foreground line-clamp-3\">\n {post.content}\n </p>\n {post.status === \"published\" && (\n <div className=\"flex items-center gap-4 text-xs text-muted-foreground\">\n <span>\n {formatNumber(post.metrics.likes)}{\" \"}\n {t(\"headshotmarketing.social.metrics.likes\", \"likes\")}\n </span>\n <span>\n {formatNumber(post.metrics.comments)}{\" \"}\n {t(\n \"headshotmarketing.social.metrics.comments\",\n \"comments\",\n )}\n </span>\n <span>\n {formatNumber(post.metrics.shares)}{\" \"}\n {t(\"headshotmarketing.social.metrics.shares\", \"shares\")}\n </span>\n </div>\n )}\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Analytics Tab */}\n {activeTab === \"analytics\" && (\n <ChartCard\n title={t(\n \"headshotmarketing.social.charts.engagementByDay\",\n \"Engagement by Day\",\n )}\n subtitle={t(\n \"headshotmarketing.social.charts.engagementByDaySubtitle\",\n \"Weekly engagement breakdown across all platforms\",\n )}\n >\n <ResponsiveContainer width=\"100%\" height={320}>\n <BarChart data={engagementData}>\n <CartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" />\n <XAxis\n dataKey=\"date\"\n className=\"text-xs\"\n tick={{ fill: \"currentColor\" }}\n />\n <YAxis className=\"text-xs\" tick={{ fill: \"currentColor\" }} />\n <Tooltip\n contentStyle={{\n backgroundColor: \"var(--color-card)\",\n border: \"1px solid var(--color-border)\",\n }}\n />\n <Legend />\n <Bar\n dataKey=\"likes\"\n fill={CHART_COLORS[0]}\n name={t(\"headshotmarketing.social.charts.likes\", \"Likes\")}\n radius={[2, 2, 0, 0]}\n />\n <Bar\n dataKey=\"comments\"\n fill={CHART_COLORS[1]}\n name={t(\"headshotmarketing.social.charts.comments\", \"Comments\")}\n radius={[2, 2, 0, 0]}\n />\n <Bar\n dataKey=\"shares\"\n fill={CHART_COLORS[2]}\n name={t(\"headshotmarketing.social.charts.shares\", \"Shares\")}\n radius={[2, 2, 0, 0]}\n />\n </BarChart>\n </ResponsiveContainer>\n </ChartCard>\n )}\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAM,IAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACD,EAEK,IAAyC;CAC7C,WAAW;CACX,UAAU;CACV,SAAS;CACT,UAAU;CACV,SAAS;CACT,QAAQ;CACT,EAIY,UAA4B;CACvC,IAAM,EAAE,gBAAa,GAAsB,EACrC,EAAE,GAAG,MAAc,GAAS,EAC5B,KAAK,GAAa,MAA6B;EACnD,IAAM,IAAQ,EAAU,EAAI;AAC5B,SAAO,MAAU,IAAM,IAAW;IAE9B,EAAE,YAAS,EAAuC,EACtD,WAAW;EAAE,OAAO;EAAK,QAAQ;EAAG,EACrC,CAAC,EACI,CAAC,GAAW,KAAgB,EAAc,WAAW,EACrD,CAAC,GAAgB,KAAqB,EAAiB,MAAM,EAE7D,IAAiB,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,QAAQ,OAAO;UAAE;UACnC,EAAE,2CAA2C,SAAS;UAClD,EAAA,CAAA;SACH;;OAEJ;QApCC,EAAK,GAoCN,CACN;KACE,CAAA,CACF;;GAIP,MAAc,eACb,kBAAC,GAAD;IACE,OAAO,EACL,mDACA,oBACD;IACD,UAAU,EACR,2DACA,mDACD;cAED,kBAAC,GAAD;KAAqB,OAAM;KAAO,QAAQ;eACxC,kBAAC,GAAD;MAAU,MAAM;gBAAhB;OACE,kBAAC,GAAD;QAAe,iBAAgB;QAAM,WAAU;QAAkB,CAAA;OACjE,kBAAC,GAAD;QACE,SAAQ;QACR,WAAU;QACV,MAAM,EAAE,MAAM,gBAAgB;QAC9B,CAAA;OACF,kBAAC,GAAD;QAAO,WAAU;QAAU,MAAM,EAAE,MAAM,gBAAgB;QAAI,CAAA;OAC7D,kBAAC,GAAD,EACE,cAAc;QACZ,iBAAiB;QACjB,QAAQ;QACT,EACD,CAAA;OACF,kBAAC,GAAD,EAAU,CAAA;OACV,kBAAC,GAAD;QACE,SAAQ;QACR,MAAM,EAAa;QACnB,MAAM,EAAE,yCAAyC,QAAQ;QACzD,QAAQ;SAAC;SAAG;SAAG;SAAG;SAAE;QACpB,CAAA;OACF,kBAAC,GAAD;QACE,SAAQ;QACR,MAAM,EAAa;QACnB,MAAM,EAAE,4CAA4C,WAAW;QAC/D,QAAQ;SAAC;SAAG;SAAG;SAAG;SAAE;QACpB,CAAA;OACF,kBAAC,GAAD;QACE,SAAQ;QACR,MAAM,EAAa;QACnB,MAAM,EAAE,0CAA0C,SAAS;QAC3D,QAAQ;SAAC;SAAG;SAAG;SAAG;SAAE;QACpB,CAAA;OACO;;KACS,CAAA;IACZ,CAAA;GAEH"}
|
|
1
|
+
{"version":3,"file":"SocialMediaPage.js","names":[],"sources":["../../../../src/headshotmarketing/pages/social-media/SocialMediaPage.tsx"],"sourcesContent":["import { useState, useMemo, type FC } from \"react\";\nimport {\n Users,\n Eye,\n Heart,\n TrendingUp,\n PenSquare,\n CalendarDays,\n Hash,\n} from \"lucide-react\";\nimport {\n BarChart,\n Bar,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n Legend,\n} from \"recharts\";\nimport { useHeadshotmarketingBootstrapDataQuery } from \"../../../generated/wspace-operations\";\nimport { cn, formatNumber, formatPercentage } from \"../../utils/helpers\";\nimport {\n toEngagementSeries,\n toHashtagSuggestions,\n toSocialAccountModel,\n toSocialPostModel,\n} from \"../../utils/socialMapper\";\nimport { PageLayout, StatCard, StatusBadge, ChartCard } from \"../../components\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { useHeadshotMarketing } from \"../../context/HeadshotMarketingContext\";\nimport type { SocialMediaAccount, SocialMediaPost } from \"../../types\";\n\nconst CHART_COLORS = [\n \"#3b82f6\",\n \"#10b981\",\n \"#f59e0b\",\n \"#ef4444\",\n \"#8b5cf6\",\n \"#ec4899\",\n];\n\nconst platformColors: Record<string, string> = {\n instagram: \"bg-pink-100 text-pink-700\",\n facebook: \"bg-blue-100 text-blue-700\",\n twitter: \"bg-sky-100 text-sky-700\",\n linkedin: \"bg-indigo-100 text-indigo-700\",\n youtube: \"bg-red-100 text-red-700\",\n tiktok: \"bg-gray-100 text-gray-700\",\n};\n\ntype Tab = \"overview\" | \"posts\" | \"analytics\";\n\nexport const SocialMediaPage: FC = () => {\n const { navigate } = useHeadshotMarketing();\n const { t: translate } = useI18n();\n const t = (key: string, fallback: string): string => {\n const value = translate(key);\n return value === key ? fallback : value;\n };\n const { data } = useHeadshotmarketingBootstrapDataQuery({\n variables: { limit: 200, offset: 0 },\n });\n const [activeTab, setActiveTab] = useState<Tab>(\"overview\");\n const [platformFilter, setPlatformFilter] = useState<string>(\"all\");\n\n const socialAccounts = useMemo<SocialMediaAccount[]>(() => {\n const items = data?.headshotmarketingSocialAccounts.items ?? [];\n return items.map((item: Parameters<typeof toSocialAccountModel>[0]) =>\n toSocialAccountModel(item),\n );\n }, [data?.headshotmarketingSocialAccounts.items]);\n\n const accountNameById = useMemo(\n () =>\n Object.fromEntries(\n (data?.headshotmarketingSocialAccounts.items ?? []).map(\n (item: { id: string; accountName: string }) => [\n item.id,\n item.accountName,\n ],\n ),\n ),\n [data?.headshotmarketingSocialAccounts.items],\n );\n\n const accountPlatformById = useMemo(\n () =>\n Object.fromEntries(\n socialAccounts.map((item) => [item.id, item.platform]),\n ),\n [socialAccounts],\n );\n\n const socialPosts = useMemo<SocialMediaPost[]>(() => {\n const items = data?.headshotmarketingSocialPosts.items ?? [];\n return items.map((item: Parameters<typeof toSocialPostModel>[0]) =>\n toSocialPostModel(item, accountNameById, accountPlatformById),\n );\n }, [\n data?.headshotmarketingSocialPosts.items,\n accountNameById,\n accountPlatformById,\n ]);\n\n const socialMetrics = useMemo(() => {\n const metrics = data?.headshotmarketingSocialMetrics;\n const totalReach = socialPosts.reduce(\n (sum: number, post: SocialMediaPost) => sum + post.metrics.reach,\n 0,\n );\n const totalImpressions = socialPosts.reduce(\n (sum: number, post: SocialMediaPost) => sum + post.metrics.impressions,\n 0,\n );\n const publishedPosts = socialPosts.filter(\n (post) => post.status === \"published\",\n );\n const averageEngagementRate =\n publishedPosts.length > 0\n ? publishedPosts.reduce(\n (sum: number, post: SocialMediaPost) =>\n sum + post.metrics.engagementRate,\n 0,\n ) / publishedPosts.length\n : 0;\n\n const platformBreakdown = Object.values(\n socialAccounts.reduce<\n Record<\n string,\n {\n platform: SocialMediaAccount[\"platform\"];\n followers: number;\n engagement: number;\n reach: number;\n }\n >\n >(\n (\n acc: Record<\n string,\n {\n platform: SocialMediaAccount[\"platform\"];\n followers: number;\n engagement: number;\n reach: number;\n }\n >,\n account: SocialMediaAccount,\n ) => {\n if (!acc[account.platform]) {\n acc[account.platform] = {\n platform: account.platform,\n followers: 0,\n engagement: 0,\n reach: 0,\n };\n }\n acc[account.platform].followers += account.followers;\n return acc;\n },\n {},\n ),\n ).map((entry) => {\n const postMetrics = socialPosts\n .filter((post) => post.platform === entry.platform)\n .reduce(\n (\n acc: { engagement: number; reach: number },\n post: SocialMediaPost,\n ) => {\n acc.engagement +=\n post.metrics.likes + post.metrics.comments + post.metrics.shares;\n acc.reach += post.metrics.reach;\n return acc;\n },\n { engagement: 0, reach: 0 },\n );\n\n return {\n ...entry,\n engagement: postMetrics.engagement,\n reach: postMetrics.reach,\n };\n });\n\n return {\n totalFollowers:\n metrics?.totalFollowers ??\n socialAccounts.reduce(\n (sum: number, account: SocialMediaAccount) => sum + account.followers,\n 0,\n ),\n totalEngagement:\n metrics?.totalEngagement ??\n socialPosts.reduce(\n (sum: number, post: SocialMediaPost) =>\n sum +\n post.metrics.likes +\n post.metrics.comments +\n post.metrics.shares,\n 0,\n ),\n totalReach,\n totalImpressions,\n averageEngagementRate,\n platformBreakdown,\n };\n }, [data?.headshotmarketingSocialMetrics, socialAccounts, socialPosts]);\n\n const hashtags = useMemo(\n () => toHashtagSuggestions(socialPosts),\n [socialPosts],\n );\n const engagementData = useMemo(\n () => toEngagementSeries(socialPosts),\n [socialPosts],\n );\n\n const filteredPosts = useMemo(() => {\n if (platformFilter === \"all\") return socialPosts;\n return socialPosts.filter(\n (p: SocialMediaPost) => p.platform === platformFilter,\n );\n }, [platformFilter, socialPosts]);\n\n const tabs: { key: Tab; label: string }[] = [\n {\n key: \"overview\",\n label: t(\"headshotmarketing.social.tabs.overview\", \"Overview\"),\n },\n { key: \"posts\", label: t(\"headshotmarketing.social.tabs.posts\", \"Posts\") },\n {\n key: \"analytics\",\n label: t(\"headshotmarketing.social.tabs.analytics\", \"Analytics\"),\n },\n ];\n\n return (\n <PageLayout\n title={t(\"headshotmarketing.social.title\", \"Social Media\")}\n description={t(\n \"headshotmarketing.social.description\",\n \"Manage and monitor your social media presence across all platforms\",\n )}\n actions={\n <div className=\"flex items-center gap-2\">\n <button\n onClick={() => navigate(\"/social-media/compose\")}\n 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\"\n >\n <PenSquare className=\"h-4 w-4\" />\n {t(\"headshotmarketing.social.actions.composePost\", \"Compose Post\")}\n </button>\n <button\n onClick={() => navigate(\"/social-media/calendar\")}\n 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\"\n >\n <CalendarDays className=\"h-4 w-4\" />\n {t(\"headshotmarketing.social.actions.calendar\", \"Calendar\")}\n </button>\n </div>\n }\n >\n {/* Connected Accounts */}\n <div className=\"flex items-center gap-3 overflow-x-auto pb-2\">\n {socialAccounts\n .filter((a: SocialMediaAccount) => a.connected)\n .map((account) => (\n <div\n key={account.id}\n className=\"flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-4 py-2 text-sm whitespace-nowrap\"\n >\n <span\n className={cn(\n \"inline-block rounded-full px-2 py-0.5 text-xs font-medium capitalize\",\n platformColors[account.platform],\n )}\n >\n {account.platform}\n </span>\n <span className=\"text-text-primary font-medium\">\n {account.handle}\n </span>\n <span className=\"text-text-secondary\">\n {formatNumber(account.followers)}\n </span>\n </div>\n ))}\n </div>\n\n {/* Tabs */}\n <div className=\"border-b border-border-subtle\">\n <div className=\"flex gap-4\">\n {tabs.map((tab) => (\n <button\n key={tab.key}\n onClick={() => setActiveTab(tab.key)}\n className={cn(\n \"px-1 py-3 text-sm font-medium border-b-2 transition-colors\",\n activeTab === tab.key\n ? \"border-foreground text-text-primary\"\n : \"border-transparent text-text-secondary hover:text-text-primary\",\n )}\n >\n {tab.label}\n </button>\n ))}\n </div>\n </div>\n\n {/* Overview Tab */}\n {activeTab === \"overview\" && (\n <div className=\"space-y-6\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatCard\n title={t(\n \"headshotmarketing.social.stats.totalFollowers\",\n \"Total Followers\",\n )}\n value={formatNumber(socialMetrics.totalFollowers)}\n change={8.4}\n changeLabel={t(\n \"headshotmarketing.common.vsLastMonth\",\n \"vs last month\",\n )}\n icon={<Users className=\"h-4 w-4\" />}\n />\n <StatCard\n title={t(\n \"headshotmarketing.social.stats.totalEngagement\",\n \"Total Engagement\",\n )}\n value={formatNumber(socialMetrics.totalEngagement)}\n change={12.3}\n changeLabel={t(\n \"headshotmarketing.common.vsLastMonth\",\n \"vs last month\",\n )}\n icon={<Heart className=\"h-4 w-4\" />}\n />\n <StatCard\n title={t(\n \"headshotmarketing.social.stats.totalReach\",\n \"Total Reach\",\n )}\n value={formatNumber(socialMetrics.totalReach)}\n change={5.7}\n changeLabel={t(\n \"headshotmarketing.common.vsLastMonth\",\n \"vs last month\",\n )}\n icon={<Eye className=\"h-4 w-4\" />}\n />\n <StatCard\n title={t(\n \"headshotmarketing.social.stats.avgEngagementRate\",\n \"Avg Engagement Rate\",\n )}\n value={formatPercentage(socialMetrics.averageEngagementRate)}\n change={0.8}\n changeLabel={t(\n \"headshotmarketing.common.vsLastMonth\",\n \"vs last month\",\n )}\n icon={<TrendingUp className=\"h-4 w-4\" />}\n />\n </div>\n\n {/* Platform Breakdown */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h3 className=\"text-sm font-semibold text-text-primary mb-4\">\n {t(\n \"headshotmarketing.social.sections.platformPerformance\",\n \"Platform Performance\",\n )}\n </h3>\n <div className=\"space-y-3\">\n {socialMetrics.platformBreakdown.map(\n (platform: {\n platform: string;\n followers: number;\n engagement: number;\n reach: number;\n }) => (\n <div\n key={platform.platform}\n className=\"flex items-center justify-between\"\n >\n <div className=\"flex items-center gap-3\">\n <span\n className={cn(\n \"inline-block rounded-full px-2.5 py-0.5 text-xs font-medium capitalize\",\n platformColors[platform.platform],\n )}\n >\n {platform.platform}\n </span>\n </div>\n <div className=\"flex items-center gap-6 text-sm\">\n <span className=\"text-text-secondary\">\n {formatNumber(platform.followers)}{\" \"}\n {t(\n \"headshotmarketing.social.metrics.followers\",\n \"followers\",\n )}\n </span>\n <span className=\"text-text-secondary\">\n {formatNumber(platform.engagement)}{\" \"}\n {t(\n \"headshotmarketing.social.metrics.engagement\",\n \"engagement\",\n )}\n </span>\n <span className=\"text-text-secondary\">\n {formatNumber(platform.reach)}{\" \"}\n {t(\"headshotmarketing.social.metrics.reach\", \"reach\")}\n </span>\n </div>\n </div>\n ),\n )}\n </div>\n </div>\n\n {/* Trending Hashtags */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h3 className=\"text-sm font-semibold text-text-primary mb-4 flex items-center gap-2\">\n <Hash className=\"h-4 w-4\" />\n {t(\n \"headshotmarketing.social.sections.trendingHashtags\",\n \"Trending Hashtags\",\n )}\n </h3>\n <div className=\"flex flex-wrap gap-2\">\n {hashtags.map((h) => (\n <span\n key={h.tag}\n className=\"inline-flex items-center gap-1 rounded-full border border-border-subtle px-3 py-1.5 text-sm text-text-primary\"\n >\n {h.tag}\n <span className=\"text-xs text-text-secondary\">\n {formatNumber(h.engagement)}\n </span>\n </span>\n ))}\n </div>\n </div>\n </div>\n )}\n\n {/* Posts Tab */}\n {activeTab === \"posts\" && (\n <div className=\"space-y-4\">\n <div className=\"flex items-center gap-2\">\n <select\n value={platformFilter}\n onChange={(e) => setPlatformFilter(e.target.value)}\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n >\n <option value=\"all\">\n {t(\n \"headshotmarketing.social.filters.allPlatforms\",\n \"All Platforms\",\n )}\n </option>\n <option value=\"instagram\">Instagram</option>\n <option value=\"facebook\">Facebook</option>\n <option value=\"twitter\">Twitter</option>\n <option value=\"linkedin\">LinkedIn</option>\n <option value=\"youtube\">YouTube</option>\n <option value=\"tiktok\">TikTok</option>\n </select>\n </div>\n\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3\">\n {filteredPosts.map((post: SocialMediaPost) => (\n <div\n key={post.id}\n className=\"rounded-lg border border-border-subtle bg-bg-surface p-4 space-y-3\"\n >\n <div className=\"flex items-center justify-between\">\n <span\n className={cn(\n \"rounded-full px-2.5 py-0.5 text-xs font-medium capitalize\",\n platformColors[post.platform],\n )}\n >\n {post.platform}\n </span>\n <StatusBadge status={post.status} />\n </div>\n <p className=\"text-sm text-text-primary line-clamp-3\">\n {post.content}\n </p>\n {post.status === \"published\" && (\n <div className=\"flex items-center gap-4 text-xs text-text-secondary\">\n <span>\n {formatNumber(post.metrics.likes)}{\" \"}\n {t(\"headshotmarketing.social.metrics.likes\", \"likes\")}\n </span>\n <span>\n {formatNumber(post.metrics.comments)}{\" \"}\n {t(\n \"headshotmarketing.social.metrics.comments\",\n \"comments\",\n )}\n </span>\n <span>\n {formatNumber(post.metrics.shares)}{\" \"}\n {t(\"headshotmarketing.social.metrics.shares\", \"shares\")}\n </span>\n </div>\n )}\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Analytics Tab */}\n {activeTab === \"analytics\" && (\n <ChartCard\n title={t(\n \"headshotmarketing.social.charts.engagementByDay\",\n \"Engagement by Day\",\n )}\n subtitle={t(\n \"headshotmarketing.social.charts.engagementByDaySubtitle\",\n \"Weekly engagement breakdown across all platforms\",\n )}\n >\n <ResponsiveContainer width=\"100%\" height={320}>\n <BarChart data={engagementData}>\n <CartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" />\n <XAxis\n dataKey=\"date\"\n className=\"text-xs\"\n tick={{ fill: \"currentColor\" }}\n />\n <YAxis className=\"text-xs\" tick={{ fill: \"currentColor\" }} />\n <Tooltip\n contentStyle={{\n backgroundColor: \"var(--color-card)\",\n border: \"1px solid var(--color-border)\",\n }}\n />\n <Legend />\n <Bar\n dataKey=\"likes\"\n fill={CHART_COLORS[0]}\n name={t(\"headshotmarketing.social.charts.likes\", \"Likes\")}\n radius={[2, 2, 0, 0]}\n />\n <Bar\n dataKey=\"comments\"\n fill={CHART_COLORS[1]}\n name={t(\"headshotmarketing.social.charts.comments\", \"Comments\")}\n radius={[2, 2, 0, 0]}\n />\n <Bar\n dataKey=\"shares\"\n fill={CHART_COLORS[2]}\n name={t(\"headshotmarketing.social.char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