@burdenoff/microfe-headshotmarketing 2026.801.2 → 2026.827.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/generated/wspace-operations.d.ts +44 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +30 -4
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/headshotmarketing/components/InfluencerModals.d.ts.map +1 -1
- package/dist/headshotmarketing/components/InfluencerModals.js +201 -214
- package/dist/headshotmarketing/components/InfluencerModals.js.map +1 -1
- package/dist/headshotmarketing/components/StatusBadge.d.ts.map +1 -1
- package/dist/headshotmarketing/components/StatusBadge.js +2 -0
- package/dist/headshotmarketing/components/StatusBadge.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js +59 -29
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/AnalyticsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/analytics/AnalyticsPage.js +389 -215
- package/dist/headshotmarketing/pages/analytics/AnalyticsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/AIExecutionLedger.d.ts +26 -0
- package/dist/headshotmarketing/pages/content/AIExecutionLedger.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/content/AIExecutionLedger.js +215 -0
- package/dist/headshotmarketing/pages/content/AIExecutionLedger.js.map +1 -0
- package/dist/headshotmarketing/pages/content/AIToolsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/content/AIToolsPage.js +396 -379
- package/dist/headshotmarketing/pages/content/AIToolsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/AssetLibraryPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/content/AssetLibraryPage.js +436 -343
- package/dist/headshotmarketing/pages/content/AssetLibraryPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentAnalyticsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentAnalyticsPage.js +233 -223
- package/dist/headshotmarketing/pages/content/ContentAnalyticsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentPage.js +4 -4
- package/dist/headshotmarketing/pages/crm/ContactsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/crm/ContactsPage.js +339 -278
- package/dist/headshotmarketing/pages/crm/ContactsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CrmPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/crm/CrmPage.js +118 -112
- package/dist/headshotmarketing/pages/crm/CrmPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CrmSubNav.d.ts +14 -0
- package/dist/headshotmarketing/pages/crm/CrmSubNav.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/crm/CrmSubNav.js +51 -0
- package/dist/headshotmarketing/pages/crm/CrmSubNav.js.map +1 -0
- package/dist/headshotmarketing/pages/crm/LeadsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/crm/LeadsPage.js +122 -116
- package/dist/headshotmarketing/pages/crm/LeadsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/PipelinePage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/crm/PipelinePage.js +192 -183
- package/dist/headshotmarketing/pages/crm/PipelinePage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js +184 -162
- package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencersPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencersPage.js +8 -14
- package/dist/headshotmarketing/pages/influencers/InfluencersPage.js.map +1 -1
- package/dist/headshotmarketing/types/index.d.ts +9 -4
- package/dist/headshotmarketing/types/index.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/contentMapper.js +1 -1
- package/dist/headshotmarketing/utils/contentMapper.js.map +1 -1
- package/dist/headshotmarketing/utils/influencerMapper.d.ts +16 -2
- package/dist/headshotmarketing/utils/influencerMapper.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/influencerMapper.js +56 -40
- package/dist/headshotmarketing/utils/influencerMapper.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,41 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
1
|
+
import { useHeadshotMarketing as e } from "../../context/HeadshotMarketingContext.js";
|
|
2
|
+
import { Legend as t } from "../../../node_modules/recharts/es6/component/Legend.js";
|
|
3
|
+
import { Tooltip as n } from "../../../node_modules/recharts/es6/component/Tooltip.js";
|
|
4
|
+
import { ResponsiveContainer as r } from "../../../node_modules/recharts/es6/component/ResponsiveContainer.js";
|
|
5
|
+
import { Bar as i } from "../../../node_modules/recharts/es6/cartesian/Bar.js";
|
|
6
|
+
import { CartesianGrid as a } from "../../../node_modules/recharts/es6/cartesian/CartesianGrid.js";
|
|
7
|
+
import { Area as o } from "../../../node_modules/recharts/es6/cartesian/Area.js";
|
|
8
|
+
import { XAxis as s } from "../../../node_modules/recharts/es6/cartesian/XAxis.js";
|
|
9
|
+
import { YAxis as c } from "../../../node_modules/recharts/es6/cartesian/YAxis.js";
|
|
10
|
+
import { BarChart as l } from "../../../node_modules/recharts/es6/chart/BarChart.js";
|
|
11
|
+
import { AreaChart as u } from "../../../node_modules/recharts/es6/chart/AreaChart.js";
|
|
12
|
+
import { formatNumber as d, formatPercentage as f } from "../../utils/helpers.js";
|
|
13
|
+
import { PageLayout as p } from "../../components/PageLayout.js";
|
|
14
|
+
import { StatCard as m } from "../../components/StatCard.js";
|
|
15
|
+
import { DataTable as h } from "../../components/DataTable.js";
|
|
16
|
+
import { ChartCard as g } from "../../components/ChartCard.js";
|
|
17
|
+
import { QueryStateBoundary as _ } from "../../components/QueryStateBoundary.js";
|
|
17
18
|
import "../../components/index.js";
|
|
18
|
-
import { useHeadshotmarketingBootstrap as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
19
|
+
import { useHeadshotmarketingBootstrap as v } from "../../hooks/useHeadshotmarketingBootstrap.js";
|
|
20
|
+
import { ContentSubNav as y } from "./ContentSubNav.js";
|
|
21
|
+
import { toContentItemModel as b, toContentPerformanceSeries as x } from "../../utils/contentMapper.js";
|
|
22
|
+
import { Eye as S, MousePointerClick as C, Share2 as w, TrendingUp as T } from "lucide-react";
|
|
23
|
+
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
24
|
+
import { EmphasisPanel as O, PagePurpose as k } from "@burdenoff/fe-libs/ui";
|
|
23
25
|
//#region src/headshotmarketing/pages/content/ContentAnalyticsPage.tsx
|
|
24
|
-
var
|
|
26
|
+
var A = [
|
|
25
27
|
"var(--color-chart-1)",
|
|
26
28
|
"var(--color-chart-2)",
|
|
27
29
|
"var(--color-chart-3)",
|
|
28
30
|
"var(--color-chart-4)",
|
|
29
31
|
"var(--color-chart-5)",
|
|
30
32
|
"var(--color-chart-6)"
|
|
31
|
-
],
|
|
33
|
+
], j = {
|
|
32
34
|
article: "Articles",
|
|
33
35
|
image: "Images",
|
|
34
36
|
video: "Videos",
|
|
35
37
|
document: "Documents",
|
|
36
38
|
template: "Templates"
|
|
37
39
|
};
|
|
38
|
-
function
|
|
40
|
+
function M(e) {
|
|
39
41
|
let t = /* @__PURE__ */ new Map();
|
|
40
42
|
for (let n of e) {
|
|
41
43
|
let e = t.get(n.type) ?? {
|
|
@@ -48,219 +50,227 @@ function A(e) {
|
|
|
48
50
|
e.views += n.metrics.views, e.shares += n.metrics.shares, e.conversions += n.metrics.conversions, e.engagementSum += n.metrics.engagement, e.count += 1, t.set(n.type, e);
|
|
49
51
|
}
|
|
50
52
|
return Array.from(t.entries()).map(([e, t]) => ({
|
|
51
|
-
type:
|
|
53
|
+
type: j[e] ?? e,
|
|
52
54
|
views: t.views,
|
|
53
55
|
shares: t.shares,
|
|
54
56
|
conversions: t.conversions,
|
|
55
57
|
engagement: t.count > 0 ? t.engagementSum / t.count : 0
|
|
56
58
|
}));
|
|
57
59
|
}
|
|
58
|
-
var
|
|
59
|
-
let { data:
|
|
60
|
-
return /* @__PURE__ */
|
|
60
|
+
var N = () => {
|
|
61
|
+
let { data: j, loading: N, error: P, refetch: F } = v(), { navigate: I, basePath: L } = e(), R = (j?.headshotmarketingContentItems.items ?? []).map((e) => b(e)), z = x(R), B = M(R), V = R.reduce((e, t) => e + t.metrics.views, 0), H = R.reduce((e, t) => e + t.metrics.shares, 0), U = R.reduce((e, t) => e + t.metrics.conversions, 0), W = R.filter((e) => e.metrics.engagement > 0), G = W.length > 0 ? W.reduce((e, t) => e + t.metrics.engagement, 0) / W.length : 0, K = R.filter((e) => e.status === "published");
|
|
62
|
+
return /* @__PURE__ */ D(p, {
|
|
61
63
|
title: "Content Analytics",
|
|
62
64
|
description: "Track content performance and engagement metrics",
|
|
63
|
-
children: [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
subtitle: "Trend over time",
|
|
99
|
-
children: /* @__PURE__ */ w(n, {
|
|
100
|
-
width: "100%",
|
|
101
|
-
height: 280,
|
|
102
|
-
children: /* @__PURE__ */ T(l, {
|
|
103
|
-
data: F,
|
|
104
|
-
children: [
|
|
105
|
-
/* @__PURE__ */ w(i, {
|
|
106
|
-
strokeDasharray: "3 3",
|
|
107
|
-
className: "stroke-border"
|
|
108
|
-
}),
|
|
109
|
-
/* @__PURE__ */ w(o, {
|
|
110
|
-
dataKey: "date",
|
|
111
|
-
tick: { fontSize: 12 },
|
|
112
|
-
className: "text-text-secondary"
|
|
113
|
-
}),
|
|
114
|
-
/* @__PURE__ */ w(s, {
|
|
115
|
-
tick: { fontSize: 12 },
|
|
116
|
-
className: "text-text-secondary"
|
|
117
|
-
}),
|
|
118
|
-
/* @__PURE__ */ w(t, {}),
|
|
119
|
-
/* @__PURE__ */ w(e, {}),
|
|
120
|
-
/* @__PURE__ */ w(a, {
|
|
121
|
-
type: "monotone",
|
|
122
|
-
dataKey: "views",
|
|
123
|
-
stroke: O[0],
|
|
124
|
-
fill: O[0],
|
|
125
|
-
fillOpacity: .1
|
|
126
|
-
}),
|
|
127
|
-
/* @__PURE__ */ w(a, {
|
|
128
|
-
type: "monotone",
|
|
129
|
-
dataKey: "shares",
|
|
130
|
-
stroke: O[1],
|
|
131
|
-
fill: O[1],
|
|
132
|
-
fillOpacity: .1
|
|
133
|
-
}),
|
|
134
|
-
/* @__PURE__ */ w(a, {
|
|
135
|
-
type: "monotone",
|
|
136
|
-
dataKey: "conversions",
|
|
137
|
-
stroke: O[2],
|
|
138
|
-
fill: O[2],
|
|
139
|
-
fillOpacity: .1
|
|
140
|
-
})
|
|
141
|
-
]
|
|
142
|
-
})
|
|
143
|
-
})
|
|
144
|
-
}), /* @__PURE__ */ w(h, {
|
|
145
|
-
title: "Performance by Content Type",
|
|
146
|
-
subtitle: "Comparison across formats",
|
|
147
|
-
children: /* @__PURE__ */ w(n, {
|
|
148
|
-
width: "100%",
|
|
149
|
-
height: 280,
|
|
150
|
-
children: /* @__PURE__ */ T(c, {
|
|
151
|
-
data: I,
|
|
152
|
-
children: [
|
|
153
|
-
/* @__PURE__ */ w(i, {
|
|
154
|
-
strokeDasharray: "3 3",
|
|
155
|
-
className: "stroke-border"
|
|
156
|
-
}),
|
|
157
|
-
/* @__PURE__ */ w(o, {
|
|
158
|
-
dataKey: "type",
|
|
159
|
-
tick: { fontSize: 12 },
|
|
160
|
-
className: "text-text-secondary"
|
|
161
|
-
}),
|
|
162
|
-
/* @__PURE__ */ w(s, {
|
|
163
|
-
tick: { fontSize: 12 },
|
|
164
|
-
className: "text-text-secondary"
|
|
165
|
-
}),
|
|
166
|
-
/* @__PURE__ */ w(t, {}),
|
|
167
|
-
/* @__PURE__ */ w(e, {}),
|
|
168
|
-
/* @__PURE__ */ w(r, {
|
|
169
|
-
dataKey: "views",
|
|
170
|
-
name: "Views",
|
|
171
|
-
fill: O[0],
|
|
172
|
-
radius: [
|
|
173
|
-
4,
|
|
174
|
-
4,
|
|
175
|
-
0,
|
|
176
|
-
0
|
|
177
|
-
]
|
|
178
|
-
}),
|
|
179
|
-
/* @__PURE__ */ w(r, {
|
|
180
|
-
dataKey: "conversions",
|
|
181
|
-
name: "Conversions",
|
|
182
|
-
fill: O[1],
|
|
183
|
-
radius: [
|
|
184
|
-
4,
|
|
185
|
-
4,
|
|
186
|
-
0,
|
|
187
|
-
0
|
|
188
|
-
]
|
|
189
|
-
})
|
|
190
|
-
]
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ E(k, { children: "See which content actually moves the needle. Track views, shares, conversions and engagement across your library so you can double down on the formats and topics that perform — and retire the ones that don't." }),
|
|
67
|
+
/* @__PURE__ */ E(y, {
|
|
68
|
+
active: "analytics",
|
|
69
|
+
basePath: L,
|
|
70
|
+
navigate: I
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ D(_, {
|
|
73
|
+
loading: N,
|
|
74
|
+
error: P,
|
|
75
|
+
onRetry: () => void F(),
|
|
76
|
+
hasData: !!j,
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ E(O, { children: /* @__PURE__ */ D("div", {
|
|
79
|
+
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ E(m, {
|
|
82
|
+
title: "Total Views",
|
|
83
|
+
value: d(V),
|
|
84
|
+
icon: /* @__PURE__ */ E(S, { className: "h-4 w-4" })
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ E(m, {
|
|
87
|
+
title: "Total Shares",
|
|
88
|
+
value: d(H),
|
|
89
|
+
icon: /* @__PURE__ */ E(w, { className: "h-4 w-4" })
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ E(m, {
|
|
92
|
+
title: "Conversions",
|
|
93
|
+
value: d(U),
|
|
94
|
+
icon: /* @__PURE__ */ E(C, { className: "h-4 w-4" })
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ E(m, {
|
|
97
|
+
title: "Avg Engagement",
|
|
98
|
+
value: f(G),
|
|
99
|
+
icon: /* @__PURE__ */ E(T, { className: "h-4 w-4" })
|
|
191
100
|
})
|
|
192
|
-
|
|
193
|
-
})
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
children: e.seoScore > 0 ? `${e.seoScore}/100` : "-"
|
|
101
|
+
]
|
|
102
|
+
}) }),
|
|
103
|
+
/* @__PURE__ */ D("div", {
|
|
104
|
+
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
105
|
+
children: [/* @__PURE__ */ E(g, {
|
|
106
|
+
title: "Content Performance",
|
|
107
|
+
subtitle: "Trend over time",
|
|
108
|
+
children: /* @__PURE__ */ E(r, {
|
|
109
|
+
width: "100%",
|
|
110
|
+
height: 280,
|
|
111
|
+
children: /* @__PURE__ */ D(u, {
|
|
112
|
+
data: z,
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ E(a, {
|
|
115
|
+
strokeDasharray: "3 3",
|
|
116
|
+
className: "stroke-border"
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ E(s, {
|
|
119
|
+
dataKey: "date",
|
|
120
|
+
tick: { fontSize: 12 },
|
|
121
|
+
className: "text-text-secondary"
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ E(c, {
|
|
124
|
+
tick: { fontSize: 12 },
|
|
125
|
+
className: "text-text-secondary"
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ E(n, {}),
|
|
128
|
+
/* @__PURE__ */ E(t, {}),
|
|
129
|
+
/* @__PURE__ */ E(o, {
|
|
130
|
+
type: "monotone",
|
|
131
|
+
dataKey: "views",
|
|
132
|
+
stroke: A[0],
|
|
133
|
+
fill: A[0],
|
|
134
|
+
fillOpacity: .1
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ E(o, {
|
|
137
|
+
type: "monotone",
|
|
138
|
+
dataKey: "shares",
|
|
139
|
+
stroke: A[1],
|
|
140
|
+
fill: A[1],
|
|
141
|
+
fillOpacity: .1
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ E(o, {
|
|
144
|
+
type: "monotone",
|
|
145
|
+
dataKey: "conversions",
|
|
146
|
+
stroke: A[2],
|
|
147
|
+
fill: A[2],
|
|
148
|
+
fillOpacity: .1
|
|
149
|
+
})
|
|
150
|
+
]
|
|
243
151
|
})
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
152
|
+
})
|
|
153
|
+
}), /* @__PURE__ */ E(g, {
|
|
154
|
+
title: "Performance by Content Type",
|
|
155
|
+
subtitle: "Comparison across formats",
|
|
156
|
+
children: /* @__PURE__ */ E(r, {
|
|
157
|
+
width: "100%",
|
|
158
|
+
height: 280,
|
|
159
|
+
children: /* @__PURE__ */ D(l, {
|
|
160
|
+
data: B,
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ E(a, {
|
|
163
|
+
strokeDasharray: "3 3",
|
|
164
|
+
className: "stroke-border"
|
|
165
|
+
}),
|
|
166
|
+
/* @__PURE__ */ E(s, {
|
|
167
|
+
dataKey: "type",
|
|
168
|
+
tick: { fontSize: 12 },
|
|
169
|
+
className: "text-text-secondary"
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ E(c, {
|
|
172
|
+
tick: { fontSize: 12 },
|
|
173
|
+
className: "text-text-secondary"
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ E(n, {}),
|
|
176
|
+
/* @__PURE__ */ E(t, {}),
|
|
177
|
+
/* @__PURE__ */ E(i, {
|
|
178
|
+
dataKey: "views",
|
|
179
|
+
name: "Views",
|
|
180
|
+
fill: A[0],
|
|
181
|
+
radius: [
|
|
182
|
+
4,
|
|
183
|
+
4,
|
|
184
|
+
0,
|
|
185
|
+
0
|
|
186
|
+
]
|
|
187
|
+
}),
|
|
188
|
+
/* @__PURE__ */ E(i, {
|
|
189
|
+
dataKey: "conversions",
|
|
190
|
+
name: "Conversions",
|
|
191
|
+
fill: A[1],
|
|
192
|
+
radius: [
|
|
193
|
+
4,
|
|
194
|
+
4,
|
|
195
|
+
0,
|
|
196
|
+
0
|
|
197
|
+
]
|
|
198
|
+
})
|
|
199
|
+
]
|
|
251
200
|
})
|
|
252
|
-
}
|
|
253
|
-
]
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
201
|
+
})
|
|
202
|
+
})]
|
|
203
|
+
}),
|
|
204
|
+
/* @__PURE__ */ E(g, {
|
|
205
|
+
title: "Top Performing Content",
|
|
206
|
+
children: /* @__PURE__ */ E(h, {
|
|
207
|
+
data: K,
|
|
208
|
+
columns: [
|
|
209
|
+
{
|
|
210
|
+
key: "title",
|
|
211
|
+
header: "Content",
|
|
212
|
+
sortable: !0,
|
|
213
|
+
render: (e) => /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("p", {
|
|
214
|
+
className: "font-medium text-text-primary",
|
|
215
|
+
children: e.title
|
|
216
|
+
}), /* @__PURE__ */ E("p", {
|
|
217
|
+
className: "text-xs text-text-secondary capitalize",
|
|
218
|
+
children: e.type
|
|
219
|
+
})] })
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
key: "views",
|
|
223
|
+
header: "Views",
|
|
224
|
+
sortable: !0,
|
|
225
|
+
render: (e) => d(e.metrics.views)
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
key: "shares",
|
|
229
|
+
header: "Shares",
|
|
230
|
+
sortable: !0,
|
|
231
|
+
render: (e) => d(e.metrics.shares)
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
key: "conversions",
|
|
235
|
+
header: "Conversions",
|
|
236
|
+
sortable: !0,
|
|
237
|
+
render: (e) => d(e.metrics.conversions)
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
key: "engagement",
|
|
241
|
+
header: "Engagement",
|
|
242
|
+
sortable: !0,
|
|
243
|
+
render: (e) => f(e.metrics.engagement)
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
key: "seoScore",
|
|
247
|
+
header: "SEO Score",
|
|
248
|
+
sortable: !0,
|
|
249
|
+
render: (e) => /* @__PURE__ */ E("span", {
|
|
250
|
+
className: e.seoScore >= 80 ? "text-status-success-text font-medium" : e.seoScore >= 50 ? "text-status-warning-text" : "text-status-error-text",
|
|
251
|
+
children: e.seoScore > 0 ? `${e.seoScore}/100` : "-"
|
|
252
|
+
})
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
key: "author",
|
|
256
|
+
header: "Author",
|
|
257
|
+
render: (e) => /* @__PURE__ */ E("span", {
|
|
258
|
+
className: "text-sm text-text-secondary",
|
|
259
|
+
children: e.author
|
|
260
|
+
})
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
searchable: !0,
|
|
264
|
+
searchPlaceholder: "Search content...",
|
|
265
|
+
pageSize: 6
|
|
266
|
+
})
|
|
257
267
|
})
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
268
|
+
]
|
|
269
|
+
})
|
|
270
|
+
]
|
|
261
271
|
});
|
|
262
272
|
};
|
|
263
273
|
//#endregion
|
|
264
|
-
export {
|
|
274
|
+
export { N as ContentAnalyticsPage };
|
|
265
275
|
|
|
266
276
|
//# sourceMappingURL=ContentAnalyticsPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentAnalyticsPage.js","names":[],"sources":["../../../../src/headshotmarketing/pages/content/ContentAnalyticsPage.tsx"],"sourcesContent":["/**\n * Content Analytics Page\n * @module headshotmarketing/pages/content\n */\n\nimport type { FC } from \"react\";\nimport { Eye, Share2, MousePointerClick, TrendingUp } from \"lucide-react\";\nimport { useHeadshotmarketingBootstrap } from \"../../hooks/useHeadshotmarketingBootstrap\";\nimport {\n AreaChart,\n Area,\n BarChart,\n Bar,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n Legend,\n} from \"recharts\";\nimport {\n PageLayout,\n StatCard,\n DataTable,\n ChartCard,\n QueryStateBoundary,\n type Column,\n} from \"../../components\";\nimport { EmphasisPanel, PagePurpose } from \"@burdenoff/fe-libs/ui\";\nimport { formatNumber, formatPercentage } from \"../../utils/helpers\";\nimport {\n toContentItemModel,\n toContentPerformanceSeries,\n} from \"../../utils/contentMapper\";\nimport type { ContentItem } from \"../../types\";\n\nconst CHART_COLORS = [\n \"var(--color-chart-1)\",\n \"var(--color-chart-2)\",\n \"var(--color-chart-3)\",\n \"var(--color-chart-4)\",\n \"var(--color-chart-5)\",\n \"var(--color-chart-6)\",\n];\n\nconst TYPE_LABELS: Record<string, string> = {\n article: \"Articles\",\n image: \"Images\",\n video: \"Videos\",\n document: \"Documents\",\n template: \"Templates\",\n};\n\ninterface TypeComparisonRow {\n type: string;\n views: number;\n shares: number;\n conversions: number;\n engagement: number;\n}\n\n/** Aggregate real content metrics by content type for the comparison chart. */\nfunction buildTypeComparison(items: ContentItem[]): TypeComparisonRow[] {\n const byType = new Map<\n string,\n {\n views: number;\n shares: number;\n conversions: number;\n engagementSum: number;\n count: number;\n }\n >();\n\n for (const item of items) {\n const entry = byType.get(item.type) ?? {\n views: 0,\n shares: 0,\n conversions: 0,\n engagementSum: 0,\n count: 0,\n };\n entry.views += item.metrics.views;\n entry.shares += item.metrics.shares;\n entry.conversions += item.metrics.conversions;\n entry.engagementSum += item.metrics.engagement;\n entry.count += 1;\n byType.set(item.type, entry);\n }\n\n return Array.from(byType.entries()).map(([type, value]) => ({\n type: TYPE_LABELS[type] ?? type,\n views: value.views,\n shares: value.shares,\n conversions: value.conversions,\n engagement: value.count > 0 ? value.engagementSum / value.count : 0,\n }));\n}\n\nexport const ContentAnalyticsPage: FC = () => {\n const { data, loading, error, refetch } = useHeadshotmarketingBootstrap();\n\n const contentItems: ContentItem[] = (\n data?.headshotmarketingContentItems.items ?? []\n ).map((item: Parameters<typeof toContentItemModel>[0]) =>\n toContentItemModel(item),\n );\n\n const contentPerformance = toContentPerformanceSeries(contentItems);\n const typeComparison = buildTypeComparison(contentItems);\n\n const totalViews = contentItems.reduce(\n (sum: number, c: ContentItem) => sum + c.metrics.views,\n 0,\n );\n const totalShares = contentItems.reduce(\n (sum: number, c: ContentItem) => sum + c.metrics.shares,\n 0,\n );\n const totalConversions = contentItems.reduce(\n (sum: number, c: ContentItem) => sum + c.metrics.conversions,\n 0,\n );\n const engaged = contentItems.filter(\n (c: ContentItem) => c.metrics.engagement > 0,\n );\n const avgEngagement =\n engaged.length > 0\n ? engaged.reduce(\n (sum: number, c: ContentItem) => sum + c.metrics.engagement,\n 0,\n ) / engaged.length\n : 0;\n\n const publishedContent = contentItems.filter(\n (c: ContentItem) => c.status === \"published\",\n );\n\n const contentColumns: Column<ContentItem>[] = [\n {\n key: \"title\",\n header: \"Content\",\n sortable: true,\n render: (row) => (\n <div>\n <p className=\"font-medium text-text-primary\">{row.title}</p>\n <p className=\"text-xs text-text-secondary capitalize\">{row.type}</p>\n </div>\n ),\n },\n {\n key: \"views\",\n header: \"Views\",\n sortable: true,\n render: (row) => formatNumber(row.metrics.views),\n },\n {\n key: \"shares\",\n header: \"Shares\",\n sortable: true,\n render: (row) => formatNumber(row.metrics.shares),\n },\n {\n key: \"conversions\",\n header: \"Conversions\",\n sortable: true,\n render: (row) => formatNumber(row.metrics.conversions),\n },\n {\n key: \"engagement\",\n header: \"Engagement\",\n sortable: true,\n render: (row) => formatPercentage(row.metrics.engagement),\n },\n {\n key: \"seoScore\",\n header: \"SEO Score\",\n sortable: true,\n render: (row) => (\n <span\n className={\n row.seoScore >= 80\n ? \"text-status-success-text font-medium\"\n : row.seoScore >= 50\n ? \"text-status-warning-text\"\n : \"text-status-error-text\"\n }\n >\n {row.seoScore > 0 ? `${row.seoScore}/100` : \"-\"}\n </span>\n ),\n },\n {\n key: \"author\",\n header: \"Author\",\n render: (row) => (\n <span className=\"text-sm text-text-secondary\">{row.author}</span>\n ),\n },\n ];\n\n return (\n <PageLayout\n title=\"Content Analytics\"\n description=\"Track content performance and engagement metrics\"\n >\n <PagePurpose>\n See which content actually moves the needle. Track views, shares,\n conversions and engagement across your library so you can double down on\n the formats and topics that perform — and retire the ones that don't.\n </PagePurpose>\n\n <QueryStateBoundary\n loading={loading}\n error={error}\n onRetry={() => void refetch()}\n hasData={Boolean(data)}\n >\n {/* Stats — primary emphasis zone */}\n <EmphasisPanel>\n <div className=\"grid grid-cols-2 md:grid-cols-4 gap-4\">\n <StatCard\n title=\"Total Views\"\n value={formatNumber(totalViews)}\n icon={<Eye className=\"h-4 w-4\" />}\n />\n <StatCard\n title=\"Total Shares\"\n value={formatNumber(totalShares)}\n icon={<Share2 className=\"h-4 w-4\" />}\n />\n <StatCard\n title=\"Conversions\"\n value={formatNumber(totalConversions)}\n icon={<MousePointerClick className=\"h-4 w-4\" />}\n />\n <StatCard\n title=\"Avg Engagement\"\n value={formatPercentage(avgEngagement)}\n icon={<TrendingUp className=\"h-4 w-4\" />}\n />\n </div>\n </EmphasisPanel>\n\n {/* Charts */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n <ChartCard title=\"Content Performance\" subtitle=\"Trend over time\">\n <ResponsiveContainer width=\"100%\" height={280}>\n <AreaChart data={contentPerformance}>\n <CartesianGrid\n strokeDasharray=\"3 3\"\n className=\"stroke-border\"\n />\n <XAxis\n dataKey=\"date\"\n tick={{ fontSize: 12 }}\n className=\"text-text-secondary\"\n />\n <YAxis\n tick={{ fontSize: 12 }}\n className=\"text-text-secondary\"\n />\n <Tooltip />\n <Legend />\n <Area\n type=\"monotone\"\n dataKey=\"views\"\n stroke={CHART_COLORS[0]}\n fill={CHART_COLORS[0]}\n fillOpacity={0.1}\n />\n <Area\n type=\"monotone\"\n dataKey=\"shares\"\n stroke={CHART_COLORS[1]}\n fill={CHART_COLORS[1]}\n fillOpacity={0.1}\n />\n <Area\n type=\"monotone\"\n dataKey=\"conversions\"\n stroke={CHART_COLORS[2]}\n fill={CHART_COLORS[2]}\n fillOpacity={0.1}\n />\n </AreaChart>\n </ResponsiveContainer>\n </ChartCard>\n\n <ChartCard\n title=\"Performance by Content Type\"\n subtitle=\"Comparison across formats\"\n >\n <ResponsiveContainer width=\"100%\" height={280}>\n <BarChart data={typeComparison}>\n <CartesianGrid\n strokeDasharray=\"3 3\"\n className=\"stroke-border\"\n />\n <XAxis\n dataKey=\"type\"\n tick={{ fontSize: 12 }}\n className=\"text-text-secondary\"\n />\n <YAxis\n tick={{ fontSize: 12 }}\n className=\"text-text-secondary\"\n />\n <Tooltip />\n <Legend />\n <Bar\n dataKey=\"views\"\n name=\"Views\"\n fill={CHART_COLORS[0]}\n radius={[4, 4, 0, 0]}\n />\n <Bar\n dataKey=\"conversions\"\n name=\"Conversions\"\n fill={CHART_COLORS[1]}\n radius={[4, 4, 0, 0]}\n />\n </BarChart>\n </ResponsiveContainer>\n </ChartCard>\n </div>\n\n {/* Top Content Table */}\n <ChartCard title=\"Top Performing Content\">\n <DataTable\n data={publishedContent}\n columns={contentColumns}\n searchable\n searchPlaceholder=\"Search content...\"\n pageSize={6}\n />\n </ChartCard>\n </QueryStateBoundary>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAM,IAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACD,EAEK,IAAsC;CAC1C,SAAS;CACT,OAAO;CACP,OAAO;CACP,UAAU;CACV,UAAU;CACX;AAWD,SAAS,EAAoB,GAA2C;CACtE,IAAM,oBAAS,IAAI,KAShB;AAEH,MAAK,IAAM,KAAQ,GAAO;EACxB,IAAM,IAAQ,EAAO,IAAI,EAAK,KAAK,IAAI;GACrC,OAAO;GACP,QAAQ;GACR,aAAa;GACb,eAAe;GACf,OAAO;GACR;AAMD,EALA,EAAM,SAAS,EAAK,QAAQ,OAC5B,EAAM,UAAU,EAAK,QAAQ,QAC7B,EAAM,eAAe,EAAK,QAAQ,aAClC,EAAM,iBAAiB,EAAK,QAAQ,YACpC,EAAM,SAAS,GACf,EAAO,IAAI,EAAK,MAAM,E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D;SACE,WACE,EAAI,YAAY,KACZ,yCACA,EAAI,YAAY,KACd,6BACA;mBAGP,EAAI,WAAW,IAAI,GAAG,EAAI,SAAS,QAAQ;SACvC,CAAA;QAEV;OACD;QACE,KAAK;QACL,QAAQ;QACR,SAAS,MACP,kBAAC,QAAD;SAAM,WAAU;mBAA+B,EAAI;SAAc,CAAA;QAEpE;OACF;MAqIS,YAAA;MACA,mBAAkB;MAClB,UAAU;MACV,CAAA;KACQ,CAAA;IACO;KACV"}
|
|
1
|
+
{"version":3,"file":"ContentAnalyticsPage.js","names":[],"sources":["../../../../src/headshotmarketing/pages/content/ContentAnalyticsPage.tsx"],"sourcesContent":["/**\n * Content Analytics Page\n * @module headshotmarketing/pages/content\n */\n\nimport type { FC } from \"react\";\nimport { Eye, Share2, MousePointerClick, TrendingUp } from \"lucide-react\";\nimport { useHeadshotmarketingBootstrap } from \"../../hooks/useHeadshotmarketingBootstrap\";\nimport {\n AreaChart,\n Area,\n BarChart,\n Bar,\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n Legend,\n} from \"recharts\";\nimport {\n PageLayout,\n StatCard,\n DataTable,\n ChartCard,\n QueryStateBoundary,\n type Column,\n} from \"../../components\";\nimport { EmphasisPanel, PagePurpose } from \"@burdenoff/fe-libs/ui\";\nimport { formatNumber, formatPercentage } from \"../../utils/helpers\";\nimport {\n toContentItemModel,\n toContentPerformanceSeries,\n} from \"../../utils/contentMapper\";\nimport { useHeadshotMarketing } from \"../../context/HeadshotMarketingContext\";\nimport type { ContentItem } from \"../../types\";\nimport { ContentSubNav } from \"./ContentSubNav\";\n\nconst CHART_COLORS = [\n \"var(--color-chart-1)\",\n \"var(--color-chart-2)\",\n \"var(--color-chart-3)\",\n \"var(--color-chart-4)\",\n \"var(--color-chart-5)\",\n \"var(--color-chart-6)\",\n];\n\nconst TYPE_LABELS: Record<string, string> = {\n article: \"Articles\",\n image: \"Images\",\n video: \"Videos\",\n document: \"Documents\",\n template: \"Templates\",\n};\n\ninterface TypeComparisonRow {\n type: string;\n views: number;\n shares: number;\n conversions: number;\n engagement: number;\n}\n\n/** Aggregate real content metrics by content type for the comparison chart. */\nfunction buildTypeComparison(items: ContentItem[]): TypeComparisonRow[] {\n const byType = new Map<\n string,\n {\n views: number;\n shares: number;\n conversions: number;\n engagementSum: number;\n count: number;\n }\n >();\n\n for (const item of items) {\n const entry = byType.get(item.type) ?? {\n views: 0,\n shares: 0,\n conversions: 0,\n engagementSum: 0,\n count: 0,\n };\n entry.views += item.metrics.views;\n entry.shares += item.metrics.shares;\n entry.conversions += item.metrics.conversions;\n entry.engagementSum += item.metrics.engagement;\n entry.count += 1;\n byType.set(item.type, entry);\n }\n\n return Array.from(byType.entries()).map(([type, value]) => ({\n type: TYPE_LABELS[type] ?? type,\n views: value.views,\n shares: value.shares,\n conversions: value.conversions,\n engagement: value.count > 0 ? value.engagementSum / value.count : 0,\n }));\n}\n\nexport const ContentAnalyticsPage: FC = () => {\n const { data, loading, error, refetch } = useHeadshotmarketingBootstrap();\n const { navigate, basePath } = useHeadshotMarketing();\n\n const contentItems: ContentItem[] = (\n data?.headshotmarketingContentItems.items ?? []\n ).map((item: Parameters<typeof toContentItemModel>[0]) =>\n toContentItemModel(item),\n );\n\n const contentPerformance = toContentPerformanceSeries(contentItems);\n const typeComparison = buildTypeComparison(contentItems);\n\n const totalViews = contentItems.reduce(\n (sum: number, c: ContentItem) => sum + c.metrics.views,\n 0,\n );\n const totalShares = contentItems.reduce(\n (sum: number, c: ContentItem) => sum + c.metrics.shares,\n 0,\n );\n const totalConversions = contentItems.reduce(\n (sum: number, c: ContentItem) => sum + c.metrics.conversions,\n 0,\n );\n const engaged = contentItems.filter(\n (c: ContentItem) => c.metrics.engagement > 0,\n );\n const avgEngagement =\n engaged.length > 0\n ? engaged.reduce(\n (sum: number, c: ContentItem) => sum + c.metrics.engagement,\n 0,\n ) / engaged.length\n : 0;\n\n const publishedContent = contentItems.filter(\n (c: ContentItem) => c.status === \"published\",\n );\n\n const contentColumns: Column<ContentItem>[] = [\n {\n key: \"title\",\n header: \"Content\",\n sortable: true,\n render: (row) => (\n <div>\n <p className=\"font-medium text-text-primary\">{row.title}</p>\n <p className=\"text-xs text-text-secondary capitalize\">{row.type}</p>\n </div>\n ),\n },\n {\n key: \"views\",\n header: \"Views\",\n sortable: true,\n render: (row) => formatNumber(row.metrics.views),\n },\n {\n key: \"shares\",\n header: \"Shares\",\n sortable: true,\n render: (row) => formatNumber(row.metrics.shares),\n },\n {\n key: \"conversions\",\n header: \"Conversions\",\n sortable: true,\n render: (row) => formatNumber(row.metrics.conversions),\n },\n {\n key: \"engagement\",\n header: \"Engagement\",\n sortable: true,\n render: (row) => formatPercentage(row.metrics.engagement),\n },\n {\n key: \"seoScore\",\n header: \"SEO Score\",\n sortable: true,\n render: (row) => (\n <span\n className={\n row.seoScore >= 80\n ? \"text-status-success-text font-medium\"\n : row.seoScore >= 50\n ? \"text-status-warning-text\"\n : \"text-status-error-text\"\n }\n >\n {row.seoScore > 0 ? `${row.seoScore}/100` : \"-\"}\n </span>\n ),\n },\n {\n key: \"author\",\n header: \"Author\",\n render: (row) => (\n <span className=\"text-sm text-text-secondary\">{row.author}</span>\n ),\n },\n ];\n\n return (\n <PageLayout\n title=\"Content Analytics\"\n description=\"Track content performance and engagement metrics\"\n >\n <PagePurpose>\n See which content actually moves the needle. Track views, shares,\n conversions and engagement across your library so you can double down on\n the formats and topics that perform — and retire the ones that don't.\n </PagePurpose>\n\n <ContentSubNav\n active=\"analytics\"\n basePath={basePath}\n navigate={navigate}\n />\n\n <QueryStateBoundary\n loading={loading}\n error={error}\n onRetry={() => void refetch()}\n hasData={Boolean(data)}\n >\n {/* Stats — primary emphasis zone */}\n <EmphasisPanel>\n <div className=\"grid grid-cols-2 md:grid-cols-4 gap-4\">\n <StatCard\n title=\"Total Views\"\n value={formatNumber(totalViews)}\n icon={<Eye className=\"h-4 w-4\" />}\n />\n <StatCard\n title=\"Total Shares\"\n value={formatNumber(totalShares)}\n icon={<Share2 className=\"h-4 w-4\" />}\n />\n <StatCard\n title=\"Conversions\"\n value={formatNumber(totalConversions)}\n icon={<MousePointerClick className=\"h-4 w-4\" />}\n />\n <StatCard\n title=\"Avg Engagement\"\n value={formatPercentage(avgEngagement)}\n icon={<TrendingUp className=\"h-4 w-4\" />}\n />\n </div>\n </EmphasisPanel>\n\n {/* Charts */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6\">\n <ChartCard title=\"Content Performance\" subtitle=\"Trend over time\">\n <ResponsiveContainer width=\"100%\" height={280}>\n <AreaChart data={contentPerformance}>\n <CartesianGrid\n strokeDasharray=\"3 3\"\n className=\"stroke-border\"\n />\n <XAxis\n dataKey=\"date\"\n tick={{ fontSize: 12 }}\n className=\"text-text-secondary\"\n />\n <YAxis\n tick={{ fontSize: 12 }}\n className=\"text-text-secondary\"\n />\n <Tooltip />\n <Legend />\n <Area\n type=\"monotone\"\n dataKey=\"views\"\n stroke={CHART_COLORS[0]}\n fill={CHART_COLORS[0]}\n fillOpacity={0.1}\n />\n <Area\n type=\"monotone\"\n dataKey=\"shares\"\n stroke={CHART_COLORS[1]}\n fill={CHART_COLORS[1]}\n fillOpacity={0.1}\n />\n <Area\n type=\"monotone\"\n dataKey=\"conversions\"\n stroke={CHART_COLORS[2]}\n fill={CHART_COLORS[2]}\n fillOpacity={0.1}\n />\n </AreaChart>\n </ResponsiveContainer>\n </ChartCard>\n\n <ChartCard\n title=\"Performance by Content Type\"\n subtitle=\"Comparison across formats\"\n >\n <ResponsiveContainer width=\"100%\" height={280}>\n <BarChart data={typeComparison}>\n <CartesianGrid\n strokeDasharray=\"3 3\"\n className=\"stroke-border\"\n />\n <XAxis\n dataKey=\"type\"\n tick={{ fontSize: 12 }}\n className=\"text-text-secondary\"\n />\n <YAxis\n tick={{ fontSize: 12 }}\n className=\"text-text-secondary\"\n />\n <Tooltip />\n <Legend />\n <Bar\n dataKey=\"views\"\n name=\"Views\"\n fill={CHART_COLORS[0]}\n radius={[4, 4, 0, 0]}\n />\n <Bar\n dataKey=\"conversions\"\n name=\"Conversions\"\n fill={CHART_COLORS[1]}\n radius={[4, 4, 0, 0]}\n />\n </BarChart>\n </ResponsiveContainer>\n </ChartCard>\n </div>\n\n {/* Top Content Table */}\n <ChartCard title=\"Top Performing Content\">\n <DataTable\n data={publishedContent}\n columns={contentColumns}\n searchable\n searchPlaceholder=\"Search content...\"\n pageSize={6}\n />\n </ChartCard>\n </QueryStateBoundary>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,IAAM,IAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACD,EAEK,IAAsC;CAC1C,SAAS;CACT,OAAO;CACP,OAAO;CACP,UAAU;CACV,UAAU;CACX;AAWD,SAAS,EAAoB,GAA2C;CACtE,IAAM,oBAAS,IAAI,KAShB;AAEH,MAAK,IAAM,KAAQ,GAAO;EACxB,IAAM,IAAQ,EAAO,IAAI,EAAK,KAAK,IAAI;GACrC,OAAO;GACP,QAAQ;GACR,aAAa;GACb,eAAe;GACf,OAAO;GACR;AAMD,EALA,EAAM,SAAS,EAAK,QAAQ,OAC5B,EAAM,UAAU,EAAK,QAAQ,QAC7B,EAAM,eAAe,EAAK,QAAQ,aAClC,EAAM,iBAAiB,EAAK,QAAQ,YACpC,EAAM,SAAS,GACf,EAAO,IAAI,EAAK,MAAM,EAAM;;AAG9B,QAAO,MAAM,KAAK,EAAO,SAAS,CAAC,CAAC,KAAK,CAAC,GAAM,QAAY;EAC1D,MAAM,EAAY,MAAS;EAC3B,OAAO,EAAM;EACb,QAAQ,EAAM;EACd,aAAa,EAAM;EACnB,YAAY,EAAM,QAAQ,IAAI,EAAM,gBAAgB,EAAM,QAAQ;EACnE,EAAE;;AAGL,IAAa,UAAiC;CAC5C,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,GAA+B,EACnE,EAAE,aAAU,gBAAa,GAAsB,EAE/C,KACJ,GAAM,8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UAAU;OACV,CAAA;MACQ,CAAA;KACO;;GACV"}
|
|
@@ -10,8 +10,8 @@ import { AssetUploadButton as s } from "../../components/AssetUploadButton.js";
|
|
|
10
10
|
import "../../components/index.js";
|
|
11
11
|
import { useHeadshotmarketingBootstrap as te } from "../../hooks/useHeadshotmarketingBootstrap.js";
|
|
12
12
|
import { usePagination as c } from "../../hooks/usePagination.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { ContentSubNav as l } from "./ContentSubNav.js";
|
|
14
|
+
import { toContentItemModel as u } from "../../utils/contentMapper.js";
|
|
15
15
|
import { ContentLibraryCard as d, ContentLibraryRow as f } from "./ContentLibraryCard.js";
|
|
16
16
|
import { useEffect as p, useState as m } from "react";
|
|
17
17
|
import { Eye as ne, FileText as re, LayoutGrid as ie, List as h, MousePointerClick as g, Plus as _, Share2 as v } from "lucide-react";
|
|
@@ -46,7 +46,7 @@ var x = [
|
|
|
46
46
|
], S = "h-10 rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", C = () => {
|
|
47
47
|
let { navigate: C, basePath: w, currentUser: T } = e(), { data: E, loading: D, error: se, refetch: O } = te(), [k, A] = m(""), [j, M] = m("all"), [N, P] = m("all"), [F, I] = m("all"), [L, R] = m("grid"), { page: z, pageSize: B, offset: V, limit: H, setPage: U, setPageSize: W, setTotal: G } = c({ initialPageSize: 12 }), K = E?.headshotmarketingContentItems.items ?? [], q = /* @__PURE__ */ new Map();
|
|
48
48
|
for (let e of K) q.set(e.id, e.scheduledAt ?? null);
|
|
49
|
-
let J = K.map((e) =>
|
|
49
|
+
let J = K.map((e) => u(e)), Y = Array.from(new Set(J.flatMap((e) => e.tags ?? []))).sort((e, t) => e.localeCompare(t)), ce = J.length, le = J.reduce((e, t) => e + t.metrics.views, 0), ue = J.reduce((e, t) => e + t.metrics.shares, 0), de = J.reduce((e, t) => e + t.metrics.conversions, 0), X = J.filter((e) => {
|
|
50
50
|
let t = !k || e.title.toLowerCase().includes(k.toLowerCase()) || e.description.toLowerCase().includes(k.toLowerCase()), n = j === "all" || e.status === j, r = N === "all" || e.type === N, i = F === "all" || (e.tags ?? []).includes(F);
|
|
51
51
|
return t && n && r && i;
|
|
52
52
|
}), Z = !!k || j !== "all" || N !== "all" || F !== "all";
|
|
@@ -81,7 +81,7 @@ var x = [
|
|
|
81
81
|
}),
|
|
82
82
|
children: [
|
|
83
83
|
/* @__PURE__ */ y(oe, { children: "One home for every piece of marketing content — blog posts, guides, videos and more. Track how each asset performs (views, shares, conversions), filter by type, status and tag, and keep your whole library organized and reusable." }),
|
|
84
|
-
/* @__PURE__ */ y(
|
|
84
|
+
/* @__PURE__ */ y(l, {
|
|
85
85
|
active: "content",
|
|
86
86
|
basePath: w,
|
|
87
87
|
navigate: C
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactsPage.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/crm/ContactsPage.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAuB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ContactsPage.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/crm/ContactsPage.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAuB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAqFrD,eAAO,MAAM,YAAY,EAAE,EAuc1B,CAAC"}
|