@burdenoff/microfe-headshotmarketing 2026.1029.6 → 2026.1030.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/wspace-operations.d.ts +2 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +2 -0
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js +474 -386
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js +94 -94
- package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AudiencesPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/ads/AudiencesPage.js +448 -339
- package/dist/headshotmarketing/pages/ads/AudiencesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.d.ts +7 -0
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js +463 -446
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/adCampaignStepper.d.ts +53 -0
- package/dist/headshotmarketing/pages/ads/adCampaignStepper.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/ads/adCampaignStepper.js +151 -0
- package/dist/headshotmarketing/pages/ads/adCampaignStepper.js.map +1 -0
- package/dist/headshotmarketing/pages/ads/audienceDetails.d.ts +31 -0
- package/dist/headshotmarketing/pages/ads/audienceDetails.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/ads/audienceDetails.js +64 -0
- package/dist/headshotmarketing/pages/ads/audienceDetails.js.map +1 -0
- package/dist/headshotmarketing/types/index.d.ts +14 -1
- package/dist/headshotmarketing/types/index.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/adsMapper.d.ts +6 -1
- package/dist/headshotmarketing/utils/adsMapper.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/adsMapper.js +27 -11
- package/dist/headshotmarketing/utils/adsMapper.js.map +1 -1
- package/dist/utils/pageContext.d.ts +60 -15
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +77 -57
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,107 +1,125 @@
|
|
|
1
1
|
import { useCreateHeadshotmarketingAdCampaignMutation as e, useDeleteHeadshotmarketingAdCampaignMutation as t, useHeadshotmarketingAdCampaignsListQuery as n, useUpdateHeadshotmarketingAdCampaignMutation as r } from "../../../generated/wspace-operations.js";
|
|
2
2
|
import { useHeadshotMarketing as i } from "../../context/HeadshotMarketingContext.js";
|
|
3
|
-
import { cn as a, formatCurrency as o, formatNumber as s, formatPercentage as
|
|
4
|
-
import { HeadshotmarketingAdCampaignStatus as
|
|
5
|
-
import { toAdCampaignModel as
|
|
6
|
-
import { PageLayout as
|
|
7
|
-
import {
|
|
3
|
+
import { cn as a, formatCurrency as o, formatNumber as s, formatPercentage as ee } from "../../utils/helpers.js";
|
|
4
|
+
import { HeadshotmarketingAdCampaignStatus as c, HeadshotmarketingAdPlatform as l } from "../../../generated/wspace-types.js";
|
|
5
|
+
import { toAdCampaignModel as u, toAdCampaignStatusEnum as d, toAdPlatformEnum as f } from "../../utils/adsMapper.js";
|
|
6
|
+
import { PageLayout as p } from "../../components/PageLayout.js";
|
|
7
|
+
import { StatCard as m } from "../../components/StatCard.js";
|
|
8
|
+
import { StatusBadge as h } from "../../components/StatusBadge.js";
|
|
8
9
|
import { EmptyState as te } from "../../components/EmptyState.js";
|
|
9
10
|
import { FilterBar as ne } from "../../components/FilterBar.js";
|
|
10
|
-
import { Modal as
|
|
11
|
+
import { Modal as g } from "../../components/Modal.js";
|
|
11
12
|
import { QueryStateBoundary as re } from "../../components/QueryStateBoundary.js";
|
|
12
13
|
import { Pagination as ie } from "../../components/Pagination.js";
|
|
13
14
|
import "../../components/index.js";
|
|
14
15
|
import { useHeadshotmarketingBootstrap as ae } from "../../hooks/useHeadshotmarketingBootstrap.js";
|
|
15
16
|
import { usePagination as oe } from "../../hooks/usePagination.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
17
|
+
import { platformLabel as _, renderPlatformIcon as v } from "./AdPlatformChips.js";
|
|
18
|
+
import { useEffect as y, useMemo as b, useState as x } from "react";
|
|
19
|
+
import { Copy as S, DollarSign as se, Eye as ce, Megaphone as le, MoreHorizontal as C, MousePointerClick as ue, Pause as de, Pencil as fe, Play as pe, Plus as w, Settings2 as T, Trash2 as E, TrendingUp as me } from "lucide-react";
|
|
20
|
+
import { useExclusiveMenu as D } from "@burdenoff/fe-libs/shared/hooks";
|
|
21
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
22
|
+
import { PagePurpose as he } from "@burdenoff/fe-libs/ui";
|
|
21
23
|
//#region src/headshotmarketing/pages/ads/AdCampaignsPage.tsx
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, le = {
|
|
35
|
-
active: l.Active,
|
|
36
|
-
paused: l.Paused,
|
|
37
|
-
completed: l.Completed,
|
|
38
|
-
draft: l.Draft
|
|
39
|
-
}, ue = {
|
|
40
|
-
google_ads: u.GoogleAds,
|
|
41
|
-
facebook: u.FacebookAds,
|
|
42
|
-
instagram: u.InstagramAds,
|
|
43
|
-
linkedin: u.LinkedinAds,
|
|
44
|
-
twitter: u.TwitterAds
|
|
24
|
+
var ge = {
|
|
25
|
+
active: c.Active,
|
|
26
|
+
paused: c.Paused,
|
|
27
|
+
completed: c.Completed,
|
|
28
|
+
draft: c.Draft
|
|
29
|
+
}, _e = {
|
|
30
|
+
google_ads: l.GoogleAds,
|
|
31
|
+
facebook: l.FacebookAds,
|
|
32
|
+
instagram: l.InstagramAds,
|
|
33
|
+
linkedin: l.LinkedinAds,
|
|
34
|
+
twitter: l.TwitterAds,
|
|
35
|
+
tiktok: l.TiktokAds
|
|
45
36
|
};
|
|
46
|
-
function
|
|
37
|
+
function j(e) {
|
|
47
38
|
if (!e) return "";
|
|
48
39
|
let t = new Date(e);
|
|
49
40
|
return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
|
|
50
41
|
}
|
|
51
|
-
var
|
|
52
|
-
let { navigate: a, basePath:
|
|
53
|
-
|
|
54
|
-
let e = setTimeout(() =>
|
|
42
|
+
var M = () => {
|
|
43
|
+
let { navigate: a, basePath: ee } = i(), l = (e) => a(ee + e), { data: h, refetch: _ } = ae(), [v, S] = x(""), [C, fe] = x(""), [T, E] = x("all"), [D, M] = x("all"), [N, P] = x(null), [F, I] = x(null), [L, R] = x(null), [z, B] = x(null), [V, H] = x(/* @__PURE__ */ new Set()), [ye, U] = x(!1), W = oe({ initialPageSize: 10 }), { limit: be, offset: xe, setPage: G, setTotal: K } = W;
|
|
44
|
+
y(() => {
|
|
45
|
+
let e = setTimeout(() => fe(v), 300);
|
|
55
46
|
return () => clearTimeout(e);
|
|
56
|
-
}, [
|
|
57
|
-
|
|
47
|
+
}, [v]), y(() => {
|
|
48
|
+
G(1);
|
|
58
49
|
}, [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
C,
|
|
51
|
+
T,
|
|
52
|
+
D,
|
|
53
|
+
G
|
|
63
54
|
]);
|
|
64
|
-
let { data:
|
|
55
|
+
let { data: q, loading: Se, error: Ce, refetch: we } = n({
|
|
65
56
|
variables: {
|
|
66
|
-
limit:
|
|
67
|
-
offset:
|
|
68
|
-
search:
|
|
69
|
-
status:
|
|
70
|
-
platform:
|
|
57
|
+
limit: be,
|
|
58
|
+
offset: xe,
|
|
59
|
+
search: C || null,
|
|
60
|
+
status: ge[T] ?? null,
|
|
61
|
+
platform: _e[D] ?? null
|
|
71
62
|
},
|
|
72
63
|
errorPolicy: "all",
|
|
73
64
|
notifyOnNetworkStatusChange: !0
|
|
74
|
-
}),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
let
|
|
79
|
-
let e = (
|
|
65
|
+
}), J = q?.headshotmarketingAdCampaigns.total ?? 0;
|
|
66
|
+
y(() => {
|
|
67
|
+
K(J);
|
|
68
|
+
}, [J, K]);
|
|
69
|
+
let Y = b(() => (q?.headshotmarketingAdCampaigns.items ?? []).map((e) => u(e)), [q?.headshotmarketingAdCampaigns.items]), X = b(() => {
|
|
70
|
+
let e = h?.headshotmarketingAdMetrics, t = (h?.headshotmarketingAdCampaigns.items ?? []).map((e) => u(e)), n = t.filter((e) => e.metrics.roas > 0), r = n.length > 0 ? n.reduce((e, t) => e + t.metrics.roas, 0) / n.length : 0;
|
|
80
71
|
return {
|
|
81
|
-
active: t,
|
|
82
|
-
totalSpend:
|
|
83
|
-
totalImpressions:
|
|
84
|
-
|
|
72
|
+
active: e?.activeAdCampaigns ?? t.filter((e) => e.status === "active").length,
|
|
73
|
+
totalSpend: e?.totalSpent ?? t.reduce((e, t) => e + t.metrics.spend, 0),
|
|
74
|
+
totalImpressions: e?.totalImpressions ?? 0,
|
|
75
|
+
totalClicks: e?.totalClicks ?? 0,
|
|
76
|
+
avgRoas: r
|
|
85
77
|
};
|
|
86
|
-
}, [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
78
|
+
}, [h?.headshotmarketingAdCampaigns.items, h?.headshotmarketingAdMetrics]);
|
|
79
|
+
y(() => {
|
|
80
|
+
H((e) => {
|
|
81
|
+
let t = new Set(Y.map((e) => e.id)), n = new Set([...e].filter((e) => t.has(e)));
|
|
82
|
+
return n.size === e.size ? e : n;
|
|
83
|
+
});
|
|
84
|
+
}, [Y]);
|
|
85
|
+
let Te = Y.length > 0 && Y.every((e) => V.has(e.id)), Ee = (e) => {
|
|
86
|
+
H((t) => {
|
|
87
|
+
let n = new Set(t);
|
|
88
|
+
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
89
|
+
});
|
|
90
|
+
}, De = () => {
|
|
91
|
+
H(Te ? /* @__PURE__ */ new Set() : new Set(Y.map((e) => e.id)));
|
|
92
|
+
}, [Oe] = e(), [Z, { loading: Q }] = r(), [ke, { loading: Ae }] = t(), $ = async () => {
|
|
93
|
+
await Promise.all([we(), _()]);
|
|
94
|
+
}, je = async (e) => {
|
|
95
|
+
P(null), B(null);
|
|
90
96
|
try {
|
|
91
|
-
await
|
|
97
|
+
await Z({ variables: {
|
|
92
98
|
id: e.id,
|
|
93
|
-
input: { status: e.status === "active" ?
|
|
99
|
+
input: { status: e.status === "active" ? c.Paused : c.Active }
|
|
94
100
|
} }), await $();
|
|
95
101
|
} catch (e) {
|
|
96
102
|
B(e instanceof Error ? e.message : "Failed to update campaign.");
|
|
97
103
|
}
|
|
98
|
-
},
|
|
99
|
-
|
|
104
|
+
}, Me = async (e) => {
|
|
105
|
+
B(null), U(!0);
|
|
106
|
+
try {
|
|
107
|
+
await Promise.all([...V].map((t) => Z({ variables: {
|
|
108
|
+
id: t,
|
|
109
|
+
input: { status: e }
|
|
110
|
+
} }))), H(/* @__PURE__ */ new Set()), await $();
|
|
111
|
+
} catch (e) {
|
|
112
|
+
B(e instanceof Error ? e.message : "Failed to update campaigns.");
|
|
113
|
+
} finally {
|
|
114
|
+
U(!1);
|
|
115
|
+
}
|
|
116
|
+
}, Ne = async (e) => {
|
|
117
|
+
P(null), B(null);
|
|
100
118
|
try {
|
|
101
|
-
await
|
|
119
|
+
await Oe({ variables: { input: {
|
|
102
120
|
name: `${e.name} (Copy)`,
|
|
103
|
-
platform:
|
|
104
|
-
status:
|
|
121
|
+
platform: f(e.platform),
|
|
122
|
+
status: c.Draft,
|
|
105
123
|
bidStrategy: e.bidStrategy,
|
|
106
124
|
totalBudget: e.budget.total > 0 ? e.budget.total : null,
|
|
107
125
|
startDate: e.startDate ? new Date(e.startDate).toISOString() : null,
|
|
@@ -111,340 +129,447 @@ var R = () => {
|
|
|
111
129
|
} catch (e) {
|
|
112
130
|
B(e instanceof Error ? e.message : "Failed to duplicate campaign.");
|
|
113
131
|
}
|
|
114
|
-
},
|
|
115
|
-
if (!
|
|
116
|
-
if (!
|
|
132
|
+
}, Pe = async () => {
|
|
133
|
+
if (!F) return;
|
|
134
|
+
if (!F.name.trim()) {
|
|
117
135
|
B("Campaign name is required.");
|
|
118
136
|
return;
|
|
119
137
|
}
|
|
120
138
|
B(null);
|
|
121
|
-
let e = Number(
|
|
139
|
+
let e = Number(F.totalBudget);
|
|
122
140
|
try {
|
|
123
|
-
await
|
|
124
|
-
id:
|
|
141
|
+
await Z({ variables: {
|
|
142
|
+
id: F.id,
|
|
125
143
|
input: {
|
|
126
|
-
name:
|
|
127
|
-
status:
|
|
128
|
-
bidStrategy:
|
|
129
|
-
totalBudget:
|
|
130
|
-
startDate:
|
|
131
|
-
endDate:
|
|
144
|
+
name: F.name.trim(),
|
|
145
|
+
status: d(F.status),
|
|
146
|
+
bidStrategy: F.bidStrategy || null,
|
|
147
|
+
totalBudget: F.totalBudget && Number.isFinite(e) ? e : null,
|
|
148
|
+
startDate: F.startDate ? new Date(F.startDate).toISOString() : null,
|
|
149
|
+
endDate: F.endDate ? new Date(F.endDate).toISOString() : null
|
|
132
150
|
}
|
|
133
|
-
} }),
|
|
151
|
+
} }), I(null), await $();
|
|
134
152
|
} catch (e) {
|
|
135
153
|
B(e instanceof Error ? e.message : "Failed to save campaign.");
|
|
136
154
|
}
|
|
137
|
-
},
|
|
138
|
-
if (
|
|
155
|
+
}, Fe = async () => {
|
|
156
|
+
if (L) {
|
|
139
157
|
B(null);
|
|
140
158
|
try {
|
|
141
|
-
await
|
|
159
|
+
await ke({ variables: { id: L.id } }), R(null), await $();
|
|
142
160
|
} catch (e) {
|
|
143
161
|
B(e instanceof Error ? e.message : "Failed to delete campaign.");
|
|
144
162
|
}
|
|
145
163
|
}
|
|
146
|
-
},
|
|
147
|
-
|
|
164
|
+
}, Ie = (e) => {
|
|
165
|
+
P(null), B(null), I({
|
|
148
166
|
id: e.id,
|
|
149
167
|
name: e.name,
|
|
150
168
|
status: e.status,
|
|
151
169
|
totalBudget: e.budget.total > 0 ? String(e.budget.total) : "",
|
|
152
170
|
bidStrategy: e.bidStrategy,
|
|
153
|
-
startDate:
|
|
154
|
-
endDate:
|
|
171
|
+
startDate: j(e.startDate),
|
|
172
|
+
endDate: j(e.endDate)
|
|
155
173
|
});
|
|
156
174
|
};
|
|
157
|
-
return /* @__PURE__ */
|
|
175
|
+
return /* @__PURE__ */ A(p, {
|
|
158
176
|
title: "Ad Campaigns",
|
|
159
177
|
description: "Create and manage your advertising campaigns",
|
|
160
|
-
actions: /* @__PURE__ */
|
|
161
|
-
onClick: () =>
|
|
178
|
+
actions: /* @__PURE__ */ A("button", {
|
|
179
|
+
onClick: () => l("/ads/campaigns/new"),
|
|
162
180
|
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",
|
|
163
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ k(w, { className: "h-4 w-4" }), "New Ad Campaign"]
|
|
164
182
|
}),
|
|
165
183
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
className: "grid grid-cols-2 gap-4
|
|
184
|
+
/* @__PURE__ */ k(he, { children: "A focused view of every ad campaign — filter by platform or status, watch budget pacing at a glance, and pause, edit or duplicate any campaign without leaving the list." }),
|
|
185
|
+
/* @__PURE__ */ A("div", {
|
|
186
|
+
className: "grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-5",
|
|
169
187
|
children: [
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
className: "
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}),
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
})
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
children: [Y.avgRoas.toFixed(1), "x"]
|
|
197
|
-
})] })
|
|
188
|
+
/* @__PURE__ */ k(m, {
|
|
189
|
+
featured: !0,
|
|
190
|
+
title: "Total Ad Spend",
|
|
191
|
+
value: o(X.totalSpend),
|
|
192
|
+
icon: /* @__PURE__ */ k(se, { className: "h-4 w-4" })
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ k(m, {
|
|
195
|
+
title: "Active Ad Campaigns",
|
|
196
|
+
value: s(X.active),
|
|
197
|
+
icon: /* @__PURE__ */ k(le, { className: "h-4 w-4" })
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ k(m, {
|
|
200
|
+
title: "Impressions",
|
|
201
|
+
value: s(X.totalImpressions),
|
|
202
|
+
icon: /* @__PURE__ */ k(ce, { className: "h-4 w-4" })
|
|
203
|
+
}),
|
|
204
|
+
/* @__PURE__ */ k(m, {
|
|
205
|
+
title: "Clicks",
|
|
206
|
+
value: s(X.totalClicks),
|
|
207
|
+
icon: /* @__PURE__ */ k(ue, { className: "h-4 w-4" })
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ k(m, {
|
|
210
|
+
title: "Avg ROAS",
|
|
211
|
+
value: `${X.avgRoas.toFixed(1)}x`,
|
|
212
|
+
icon: /* @__PURE__ */ k(me, { className: "h-4 w-4" })
|
|
213
|
+
})
|
|
198
214
|
]
|
|
199
|
-
})
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
searchValue:
|
|
202
|
-
onSearchChange:
|
|
215
|
+
}),
|
|
216
|
+
/* @__PURE__ */ k(ne, {
|
|
217
|
+
searchValue: v,
|
|
218
|
+
onSearchChange: S,
|
|
203
219
|
searchPlaceholder: "Search campaigns...",
|
|
204
|
-
filters: /* @__PURE__ */
|
|
205
|
-
|
|
206
|
-
|
|
220
|
+
filters: /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ A("select", {
|
|
221
|
+
"aria-label": "Status",
|
|
222
|
+
value: T,
|
|
223
|
+
onChange: (e) => E(e.target.value),
|
|
207
224
|
className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
|
|
208
225
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ k("option", {
|
|
210
227
|
value: "all",
|
|
211
228
|
children: "All Status"
|
|
212
229
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ k("option", {
|
|
214
231
|
value: "active",
|
|
215
232
|
children: "Active"
|
|
216
233
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ k("option", {
|
|
218
235
|
value: "paused",
|
|
219
236
|
children: "Paused"
|
|
220
237
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ k("option", {
|
|
222
239
|
value: "completed",
|
|
223
240
|
children: "Completed"
|
|
224
241
|
}),
|
|
225
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ k("option", {
|
|
226
243
|
value: "draft",
|
|
227
244
|
children: "Draft"
|
|
228
245
|
})
|
|
229
246
|
]
|
|
230
|
-
}), /* @__PURE__ */
|
|
231
|
-
|
|
232
|
-
|
|
247
|
+
}), /* @__PURE__ */ A("select", {
|
|
248
|
+
"aria-label": "Platform",
|
|
249
|
+
value: D,
|
|
250
|
+
onChange: (e) => M(e.target.value),
|
|
233
251
|
className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
|
|
234
252
|
children: [
|
|
235
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ k("option", {
|
|
236
254
|
value: "all",
|
|
237
255
|
children: "All Platforms"
|
|
238
256
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ k("option", {
|
|
240
258
|
value: "google_ads",
|
|
241
259
|
children: "Google Ads"
|
|
242
260
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ k("option", {
|
|
244
262
|
value: "facebook",
|
|
245
263
|
children: "Facebook"
|
|
246
264
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ k("option", {
|
|
248
266
|
value: "instagram",
|
|
249
267
|
children: "Instagram"
|
|
250
268
|
}),
|
|
251
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ k("option", {
|
|
252
270
|
value: "linkedin",
|
|
253
271
|
children: "LinkedIn"
|
|
254
272
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ k("option", {
|
|
256
274
|
value: "twitter",
|
|
257
275
|
children: "Twitter"
|
|
276
|
+
}),
|
|
277
|
+
/* @__PURE__ */ k("option", {
|
|
278
|
+
value: "tiktok",
|
|
279
|
+
children: "TikTok"
|
|
258
280
|
})
|
|
259
281
|
]
|
|
260
282
|
})] })
|
|
261
283
|
}),
|
|
262
|
-
z && /* @__PURE__ */
|
|
284
|
+
z && /* @__PURE__ */ k("div", {
|
|
263
285
|
role: "alert",
|
|
264
286
|
className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
|
|
265
287
|
children: z
|
|
266
288
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
loading:
|
|
269
|
-
error:
|
|
270
|
-
onRetry:
|
|
271
|
-
hasData: !!
|
|
272
|
-
children:
|
|
273
|
-
illustration:
|
|
274
|
-
title:
|
|
275
|
-
description:
|
|
276
|
-
action:
|
|
277
|
-
onClick: () =>
|
|
289
|
+
/* @__PURE__ */ k(re, {
|
|
290
|
+
loading: Se,
|
|
291
|
+
error: Ce,
|
|
292
|
+
onRetry: we,
|
|
293
|
+
hasData: !!q,
|
|
294
|
+
children: Y.length === 0 ? /* @__PURE__ */ k(te, {
|
|
295
|
+
illustration: J === 0 ? "empty-generic" : "empty-search",
|
|
296
|
+
title: J === 0 ? "No ad campaigns yet" : "No campaigns match your filters",
|
|
297
|
+
description: J === 0 ? "Create your first ad campaign to start running paid traffic." : "Try a different search term, platform or status.",
|
|
298
|
+
action: J === 0 ? /* @__PURE__ */ A("button", {
|
|
299
|
+
onClick: () => l("/ads/campaigns/new"),
|
|
278
300
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
279
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ k(w, { className: "h-4 w-4" }), "Create Campaign"]
|
|
280
302
|
}) : void 0
|
|
281
|
-
}) : /* @__PURE__ */
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
303
|
+
}) : /* @__PURE__ */ A(O, { children: [
|
|
304
|
+
V.size > 0 && /* @__PURE__ */ A("div", {
|
|
305
|
+
className: "flex flex-wrap items-center gap-2 rounded-lg border border-border-seam bg-bg-surface px-4 py-2 text-sm",
|
|
306
|
+
children: [
|
|
307
|
+
/* @__PURE__ */ A("span", {
|
|
308
|
+
className: "font-medium text-text-primary",
|
|
309
|
+
children: [V.size, " selected"]
|
|
310
|
+
}),
|
|
311
|
+
/* @__PURE__ */ A("button", {
|
|
312
|
+
onClick: () => Me(c.Paused),
|
|
313
|
+
disabled: ye,
|
|
314
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-text-primary hover:bg-bg-sunken disabled:opacity-60",
|
|
315
|
+
children: [/* @__PURE__ */ k(de, { className: "h-3.5 w-3.5" }), "Pause"]
|
|
316
|
+
}),
|
|
317
|
+
/* @__PURE__ */ A("button", {
|
|
318
|
+
onClick: () => Me(c.Active),
|
|
319
|
+
disabled: ye,
|
|
320
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-text-primary hover:bg-bg-sunken disabled:opacity-60",
|
|
321
|
+
children: [/* @__PURE__ */ k(pe, { className: "h-3.5 w-3.5" }), "Activate"]
|
|
322
|
+
}),
|
|
323
|
+
/* @__PURE__ */ k("button", {
|
|
324
|
+
onClick: () => H(/* @__PURE__ */ new Set()),
|
|
325
|
+
className: "ml-auto text-text-secondary hover:text-text-primary",
|
|
326
|
+
children: "Clear"
|
|
327
|
+
})
|
|
328
|
+
]
|
|
329
|
+
}),
|
|
330
|
+
/* @__PURE__ */ k("div", {
|
|
331
|
+
className: "overflow-x-auto rounded-lg border border-border-seam bg-gloss-card shadow-pop",
|
|
332
|
+
children: /* @__PURE__ */ A("table", {
|
|
333
|
+
className: "w-full min-w-[960px] text-sm",
|
|
334
|
+
"aria-label": "Ad campaigns",
|
|
335
|
+
children: [/* @__PURE__ */ k("thead", {
|
|
336
|
+
className: "border-b border-border-seam bg-bg-sunken/60 text-left text-xs font-medium text-text-secondary",
|
|
337
|
+
children: /* @__PURE__ */ A("tr", { children: [
|
|
338
|
+
/* @__PURE__ */ k("th", {
|
|
339
|
+
scope: "col",
|
|
340
|
+
className: "w-10 px-4 py-3",
|
|
341
|
+
children: /* @__PURE__ */ k("input", {
|
|
342
|
+
type: "checkbox",
|
|
343
|
+
"aria-label": "Select all campaigns on this page",
|
|
344
|
+
checked: Te,
|
|
345
|
+
onChange: De,
|
|
346
|
+
className: "h-4 w-4 rounded border-border-subtle"
|
|
347
|
+
})
|
|
348
|
+
}),
|
|
349
|
+
/* @__PURE__ */ k("th", {
|
|
350
|
+
scope: "col",
|
|
351
|
+
className: "px-3 py-3",
|
|
352
|
+
children: "Campaign"
|
|
353
|
+
}),
|
|
354
|
+
/* @__PURE__ */ k("th", {
|
|
355
|
+
scope: "col",
|
|
356
|
+
className: "px-3 py-3",
|
|
357
|
+
children: "Platform"
|
|
358
|
+
}),
|
|
359
|
+
/* @__PURE__ */ k("th", {
|
|
360
|
+
scope: "col",
|
|
361
|
+
className: "px-3 py-3",
|
|
362
|
+
children: "Status"
|
|
363
|
+
}),
|
|
364
|
+
/* @__PURE__ */ k("th", {
|
|
365
|
+
scope: "col",
|
|
366
|
+
className: "px-3 py-3 text-right",
|
|
367
|
+
children: "Daily Budget"
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ k("th", {
|
|
370
|
+
scope: "col",
|
|
371
|
+
className: "px-3 py-3",
|
|
372
|
+
children: "Spent"
|
|
373
|
+
}),
|
|
374
|
+
/* @__PURE__ */ k("th", {
|
|
375
|
+
scope: "col",
|
|
376
|
+
className: "px-3 py-3 text-right",
|
|
377
|
+
children: "Impressions"
|
|
378
|
+
}),
|
|
379
|
+
/* @__PURE__ */ k("th", {
|
|
380
|
+
scope: "col",
|
|
381
|
+
className: "px-3 py-3 text-right",
|
|
382
|
+
children: "Clicks"
|
|
383
|
+
}),
|
|
384
|
+
/* @__PURE__ */ k("th", {
|
|
385
|
+
scope: "col",
|
|
386
|
+
className: "px-3 py-3 text-right",
|
|
387
|
+
children: "CTR"
|
|
388
|
+
}),
|
|
389
|
+
/* @__PURE__ */ k("th", {
|
|
390
|
+
scope: "col",
|
|
391
|
+
className: "px-3 py-3 text-right",
|
|
392
|
+
children: "ROAS"
|
|
393
|
+
}),
|
|
394
|
+
/* @__PURE__ */ k("th", {
|
|
395
|
+
scope: "col",
|
|
396
|
+
className: "w-12 px-3 py-3",
|
|
397
|
+
children: /* @__PURE__ */ k("span", {
|
|
398
|
+
className: "sr-only",
|
|
399
|
+
children: "Actions"
|
|
400
|
+
})
|
|
401
|
+
})
|
|
402
|
+
] })
|
|
403
|
+
}), /* @__PURE__ */ k("tbody", { children: Y.map((e) => /* @__PURE__ */ k(ve, {
|
|
404
|
+
campaign: e,
|
|
405
|
+
selected: V.has(e.id),
|
|
406
|
+
onToggleSelected: () => Ee(e.id),
|
|
407
|
+
menuOpen: N === e.id,
|
|
408
|
+
onToggleMenu: () => P(N === e.id ? null : e.id),
|
|
409
|
+
onCloseMenu: () => P(null),
|
|
410
|
+
onManage: () => l("/ads/campaigns/" + e.id),
|
|
411
|
+
onEdit: () => Ie(e),
|
|
412
|
+
onToggleStatus: () => je(e),
|
|
413
|
+
onDuplicate: () => Ne(e),
|
|
414
|
+
onDelete: () => {
|
|
415
|
+
P(null), R(e);
|
|
416
|
+
}
|
|
417
|
+
}, e.id)) })]
|
|
418
|
+
})
|
|
419
|
+
}),
|
|
420
|
+
/* @__PURE__ */ k(ie, {
|
|
421
|
+
page: W.page,
|
|
422
|
+
pageSize: W.pageSize,
|
|
423
|
+
total: W.total,
|
|
424
|
+
onPageChange: W.setPage,
|
|
425
|
+
onPageSizeChange: W.setPageSize,
|
|
426
|
+
disabled: Se,
|
|
427
|
+
hideWhenSinglePage: !0
|
|
428
|
+
})
|
|
429
|
+
] })
|
|
305
430
|
}),
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
open:
|
|
308
|
-
onClose: () =>
|
|
431
|
+
/* @__PURE__ */ k(g, {
|
|
432
|
+
open: F !== null,
|
|
433
|
+
onClose: () => I(null),
|
|
309
434
|
title: "Edit Campaign",
|
|
310
435
|
description: "Update campaign details",
|
|
311
436
|
size: "lg",
|
|
312
|
-
footer: /* @__PURE__ */
|
|
313
|
-
onClick: () =>
|
|
437
|
+
footer: /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("button", {
|
|
438
|
+
onClick: () => I(null),
|
|
314
439
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
315
440
|
children: "Cancel"
|
|
316
|
-
}), /* @__PURE__ */
|
|
317
|
-
onClick:
|
|
318
|
-
disabled:
|
|
441
|
+
}), /* @__PURE__ */ k("button", {
|
|
442
|
+
onClick: Pe,
|
|
443
|
+
disabled: Q,
|
|
319
444
|
className: "rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90 disabled:opacity-60",
|
|
320
|
-
children:
|
|
445
|
+
children: Q ? "Saving..." : "Save Changes"
|
|
321
446
|
})] }),
|
|
322
|
-
children:
|
|
447
|
+
children: F && /* @__PURE__ */ A("div", {
|
|
323
448
|
className: "space-y-4",
|
|
324
449
|
children: [
|
|
325
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
326
451
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
327
452
|
children: "Campaign Name"
|
|
328
|
-
}), /* @__PURE__ */
|
|
453
|
+
}), /* @__PURE__ */ k("input", {
|
|
329
454
|
type: "text",
|
|
330
|
-
value:
|
|
331
|
-
onChange: (e) =>
|
|
332
|
-
...
|
|
455
|
+
value: F.name,
|
|
456
|
+
onChange: (e) => I({
|
|
457
|
+
...F,
|
|
333
458
|
name: e.target.value
|
|
334
459
|
}),
|
|
335
460
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
336
461
|
})] }),
|
|
337
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ A("div", {
|
|
338
463
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
339
|
-
children: [/* @__PURE__ */
|
|
464
|
+
children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
340
465
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
341
466
|
children: "Status"
|
|
342
|
-
}), /* @__PURE__ */
|
|
343
|
-
value:
|
|
344
|
-
onChange: (e) =>
|
|
345
|
-
...
|
|
467
|
+
}), /* @__PURE__ */ A("select", {
|
|
468
|
+
value: F.status,
|
|
469
|
+
onChange: (e) => I({
|
|
470
|
+
...F,
|
|
346
471
|
status: e.target.value
|
|
347
472
|
}),
|
|
348
473
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
349
474
|
children: [
|
|
350
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ k("option", {
|
|
351
476
|
value: "draft",
|
|
352
477
|
children: "Draft"
|
|
353
478
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ k("option", {
|
|
355
480
|
value: "active",
|
|
356
481
|
children: "Active"
|
|
357
482
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ k("option", {
|
|
359
484
|
value: "paused",
|
|
360
485
|
children: "Paused"
|
|
361
486
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ k("option", {
|
|
363
488
|
value: "completed",
|
|
364
489
|
children: "Completed"
|
|
365
490
|
})
|
|
366
491
|
]
|
|
367
|
-
})] }), /* @__PURE__ */
|
|
492
|
+
})] }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
368
493
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
369
494
|
children: "Total Budget (USD)"
|
|
370
|
-
}), /* @__PURE__ */
|
|
495
|
+
}), /* @__PURE__ */ k("input", {
|
|
371
496
|
type: "number",
|
|
372
|
-
value:
|
|
373
|
-
onChange: (e) =>
|
|
374
|
-
...
|
|
497
|
+
value: F.totalBudget,
|
|
498
|
+
onChange: (e) => I({
|
|
499
|
+
...F,
|
|
375
500
|
totalBudget: e.target.value
|
|
376
501
|
}),
|
|
377
502
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
378
503
|
})] })]
|
|
379
504
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
381
506
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
382
507
|
children: "Bid Strategy"
|
|
383
|
-
}), /* @__PURE__ */
|
|
508
|
+
}), /* @__PURE__ */ k("input", {
|
|
384
509
|
type: "text",
|
|
385
|
-
value:
|
|
386
|
-
onChange: (e) =>
|
|
387
|
-
...
|
|
510
|
+
value: F.bidStrategy,
|
|
511
|
+
onChange: (e) => I({
|
|
512
|
+
...F,
|
|
388
513
|
bidStrategy: e.target.value
|
|
389
514
|
}),
|
|
390
515
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
391
516
|
})] }),
|
|
392
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ A("div", {
|
|
393
518
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
394
|
-
children: [/* @__PURE__ */
|
|
519
|
+
children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
395
520
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
396
521
|
children: "Start Date"
|
|
397
|
-
}), /* @__PURE__ */
|
|
522
|
+
}), /* @__PURE__ */ k("input", {
|
|
398
523
|
type: "date",
|
|
399
|
-
value:
|
|
400
|
-
onChange: (e) =>
|
|
401
|
-
...
|
|
524
|
+
value: F.startDate,
|
|
525
|
+
onChange: (e) => I({
|
|
526
|
+
...F,
|
|
402
527
|
startDate: e.target.value
|
|
403
528
|
}),
|
|
404
529
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
405
|
-
})] }), /* @__PURE__ */
|
|
530
|
+
})] }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
406
531
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
407
532
|
children: "End Date"
|
|
408
|
-
}), /* @__PURE__ */
|
|
533
|
+
}), /* @__PURE__ */ k("input", {
|
|
409
534
|
type: "date",
|
|
410
|
-
value:
|
|
411
|
-
onChange: (e) =>
|
|
412
|
-
...
|
|
535
|
+
value: F.endDate,
|
|
536
|
+
onChange: (e) => I({
|
|
537
|
+
...F,
|
|
413
538
|
endDate: e.target.value
|
|
414
539
|
}),
|
|
415
540
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
416
541
|
})] })]
|
|
417
542
|
}),
|
|
418
|
-
z && /* @__PURE__ */
|
|
543
|
+
z && /* @__PURE__ */ k("p", {
|
|
419
544
|
className: "text-sm text-status-error-text",
|
|
420
545
|
children: z
|
|
421
546
|
})
|
|
422
547
|
]
|
|
423
548
|
})
|
|
424
549
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
-
open:
|
|
550
|
+
/* @__PURE__ */ k(g, {
|
|
551
|
+
open: L !== null,
|
|
427
552
|
onClose: () => R(null),
|
|
428
553
|
title: "Delete Campaign",
|
|
429
554
|
size: "sm",
|
|
430
|
-
footer: /* @__PURE__ */
|
|
555
|
+
footer: /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("button", {
|
|
431
556
|
onClick: () => R(null),
|
|
432
557
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
433
558
|
children: "Cancel"
|
|
434
|
-
}), /* @__PURE__ */
|
|
435
|
-
onClick:
|
|
436
|
-
disabled:
|
|
559
|
+
}), /* @__PURE__ */ k("button", {
|
|
560
|
+
onClick: Fe,
|
|
561
|
+
disabled: Ae,
|
|
437
562
|
className: "rounded-md bg-status-error-text px-4 py-2 text-sm font-medium text-background hover:opacity-90 disabled:opacity-60",
|
|
438
|
-
children:
|
|
563
|
+
children: Ae ? "Deleting..." : "Delete"
|
|
439
564
|
})] }),
|
|
440
|
-
children: /* @__PURE__ */
|
|
565
|
+
children: /* @__PURE__ */ A("p", {
|
|
441
566
|
className: "text-sm text-text-secondary",
|
|
442
567
|
children: [
|
|
443
568
|
"Are you sure you want to delete",
|
|
444
569
|
" ",
|
|
445
|
-
/* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ k("span", {
|
|
446
571
|
className: "font-semibold text-text-primary",
|
|
447
|
-
children:
|
|
572
|
+
children: L?.name
|
|
448
573
|
}),
|
|
449
574
|
"? This action cannot be undone."
|
|
450
575
|
]
|
|
@@ -452,178 +577,141 @@ var R = () => {
|
|
|
452
577
|
})
|
|
453
578
|
]
|
|
454
579
|
});
|
|
455
|
-
},
|
|
456
|
-
|
|
457
|
-
let
|
|
458
|
-
return /* @__PURE__ */
|
|
459
|
-
className: "
|
|
580
|
+
}, ve = ({ campaign: e, selected: t, onToggleSelected: n, menuOpen: r, onToggleMenu: i, onCloseMenu: c, onManage: l, onEdit: u, onToggleStatus: d, onDuplicate: f, onDelete: p }) => {
|
|
581
|
+
D(`ad-campaign-${e.id}`, r, c);
|
|
582
|
+
let m = e.budget.total > 0 ? e.budget.spent / e.budget.total * 100 : 0;
|
|
583
|
+
return /* @__PURE__ */ A("tr", {
|
|
584
|
+
className: a("border-b border-border-subtle last:border-b-0 hover:bg-bg-sunken/40", t && "bg-bg-sunken/60"),
|
|
460
585
|
children: [
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
className: "
|
|
463
|
-
children:
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
}), /* @__PURE__ */
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
586
|
+
/* @__PURE__ */ k("td", {
|
|
587
|
+
className: "px-4 py-3",
|
|
588
|
+
children: /* @__PURE__ */ k("input", {
|
|
589
|
+
type: "checkbox",
|
|
590
|
+
"aria-label": `Select ${e.name}`,
|
|
591
|
+
checked: t,
|
|
592
|
+
onChange: n,
|
|
593
|
+
className: "h-4 w-4 rounded border-border-subtle"
|
|
594
|
+
})
|
|
595
|
+
}),
|
|
596
|
+
/* @__PURE__ */ A("td", {
|
|
597
|
+
className: "px-3 py-3",
|
|
598
|
+
children: [/* @__PURE__ */ k("button", {
|
|
599
|
+
onClick: l,
|
|
600
|
+
className: "block max-w-[260px] truncate rounded text-left font-medium text-text-primary hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
601
|
+
children: e.name
|
|
602
|
+
}), /* @__PURE__ */ A("div", {
|
|
603
|
+
className: "mt-1 flex items-center gap-1.5 text-xs text-text-secondary",
|
|
604
|
+
children: [/* @__PURE__ */ k("span", { children: "Sync:" }), /* @__PURE__ */ k(h, {
|
|
605
|
+
status: e.syncStatus,
|
|
606
|
+
className: "px-1.5 py-0 text-[10px]"
|
|
607
|
+
})]
|
|
608
|
+
})]
|
|
609
|
+
}),
|
|
610
|
+
/* @__PURE__ */ k("td", {
|
|
611
|
+
className: "px-3 py-3",
|
|
612
|
+
children: /* @__PURE__ */ A("span", {
|
|
613
|
+
className: "inline-flex items-center gap-2 whitespace-nowrap text-text-primary",
|
|
614
|
+
children: [v(e.platform, "h-4 w-4 shrink-0"), _(e.platform)]
|
|
615
|
+
})
|
|
616
|
+
}),
|
|
617
|
+
/* @__PURE__ */ k("td", {
|
|
618
|
+
className: "px-3 py-3",
|
|
619
|
+
children: /* @__PURE__ */ k(h, { status: e.status })
|
|
620
|
+
}),
|
|
621
|
+
/* @__PURE__ */ k("td", {
|
|
622
|
+
className: "whitespace-nowrap px-3 py-3 text-right tabular-nums text-text-primary",
|
|
623
|
+
children: e.dailyBudget > 0 ? o(e.dailyBudget) : "—"
|
|
624
|
+
}),
|
|
625
|
+
/* @__PURE__ */ k("td", {
|
|
626
|
+
className: "px-3 py-3",
|
|
627
|
+
children: /* @__PURE__ */ A("div", {
|
|
628
|
+
className: "flex items-center gap-2",
|
|
629
|
+
children: [/* @__PURE__ */ k("span", {
|
|
630
|
+
className: "whitespace-nowrap tabular-nums text-text-primary",
|
|
631
|
+
children: o(e.budget.spent)
|
|
632
|
+
}), /* @__PURE__ */ k("div", {
|
|
633
|
+
className: "h-1.5 w-16 overflow-hidden rounded-full bg-bg-sunken",
|
|
634
|
+
role: "progressbar",
|
|
635
|
+
"aria-label": `Budget used for ${e.name}`,
|
|
636
|
+
"aria-valuemin": 0,
|
|
637
|
+
"aria-valuemax": 100,
|
|
638
|
+
"aria-valuenow": Math.round(Math.min(m, 100)),
|
|
639
|
+
children: /* @__PURE__ */ k("div", {
|
|
640
|
+
className: a("h-full rounded-full", m > 90 ? "bg-status-error-text" : m > 70 ? "bg-status-warning-text" : "bg-status-success-text"),
|
|
641
|
+
style: { width: `${Math.min(m, 100)}%` }
|
|
642
|
+
})
|
|
491
643
|
})]
|
|
492
|
-
})
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
644
|
+
})
|
|
645
|
+
}),
|
|
646
|
+
/* @__PURE__ */ k("td", {
|
|
647
|
+
className: "px-3 py-3 text-right tabular-nums text-text-primary",
|
|
648
|
+
children: s(e.metrics.impressions)
|
|
649
|
+
}),
|
|
650
|
+
/* @__PURE__ */ k("td", {
|
|
651
|
+
className: "px-3 py-3 text-right tabular-nums text-text-primary",
|
|
652
|
+
children: s(e.metrics.clicks)
|
|
653
|
+
}),
|
|
654
|
+
/* @__PURE__ */ k("td", {
|
|
655
|
+
className: "px-3 py-3 text-right tabular-nums text-text-primary",
|
|
656
|
+
children: ee(e.metrics.ctr, 2)
|
|
657
|
+
}),
|
|
658
|
+
/* @__PURE__ */ A("td", {
|
|
659
|
+
className: "px-3 py-3 text-right tabular-nums text-text-primary",
|
|
660
|
+
children: [e.metrics.roas.toFixed(1), "x"]
|
|
661
|
+
}),
|
|
662
|
+
/* @__PURE__ */ k("td", {
|
|
663
|
+
className: "px-3 py-3",
|
|
664
|
+
children: /* @__PURE__ */ A("div", {
|
|
665
|
+
className: "relative flex justify-end",
|
|
666
|
+
children: [/* @__PURE__ */ k("button", {
|
|
667
|
+
onClick: i,
|
|
496
668
|
"aria-haspopup": "menu",
|
|
497
|
-
"aria-expanded":
|
|
498
|
-
"aria-label":
|
|
499
|
-
className: "rounded-md p-1.5 text-text-secondary hover:
|
|
500
|
-
children: /* @__PURE__ */
|
|
501
|
-
}),
|
|
669
|
+
"aria-expanded": r,
|
|
670
|
+
"aria-label": `Actions for ${e.name}`,
|
|
671
|
+
className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary",
|
|
672
|
+
children: /* @__PURE__ */ k(C, { className: "h-4 w-4" })
|
|
673
|
+
}), r && /* @__PURE__ */ A("div", {
|
|
502
674
|
role: "menu",
|
|
503
675
|
className: "absolute right-0 top-8 z-20 w-44 rounded-md border border-border-seam bg-gloss-card py-1 shadow-lg",
|
|
504
676
|
children: [
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
role: "menuitem",
|
|
507
|
-
onClick: i,
|
|
508
|
-
className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
|
|
509
|
-
children: [/* @__PURE__ */ N(O, { className: "h-3.5 w-3.5" }), "Manage"]
|
|
510
|
-
}),
|
|
511
|
-
/* @__PURE__ */ P("button", {
|
|
677
|
+
/* @__PURE__ */ A("button", {
|
|
512
678
|
role: "menuitem",
|
|
513
679
|
onClick: l,
|
|
514
680
|
className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
|
|
515
|
-
children: [/* @__PURE__ */
|
|
681
|
+
children: [/* @__PURE__ */ k(T, { className: "h-3.5 w-3.5" }), "Manage"]
|
|
516
682
|
}),
|
|
517
|
-
/* @__PURE__ */
|
|
683
|
+
/* @__PURE__ */ A("button", {
|
|
518
684
|
role: "menuitem",
|
|
519
685
|
onClick: u,
|
|
520
686
|
className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
|
|
521
|
-
children:
|
|
687
|
+
children: [/* @__PURE__ */ k(fe, { className: "h-3.5 w-3.5" }), "Edit"]
|
|
522
688
|
}),
|
|
523
|
-
/* @__PURE__ */
|
|
689
|
+
/* @__PURE__ */ k("button", {
|
|
524
690
|
role: "menuitem",
|
|
525
691
|
onClick: d,
|
|
526
692
|
className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
|
|
527
|
-
children: [/* @__PURE__ */
|
|
693
|
+
children: e.status === "active" ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(de, { className: "h-3.5 w-3.5" }), "Pause"] }) : /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(pe, { className: "h-3.5 w-3.5" }), "Resume"] })
|
|
528
694
|
}),
|
|
529
|
-
/* @__PURE__ */
|
|
695
|
+
/* @__PURE__ */ A("button", {
|
|
530
696
|
role: "menuitem",
|
|
531
697
|
onClick: f,
|
|
698
|
+
className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
|
|
699
|
+
children: [/* @__PURE__ */ k(S, { className: "h-3.5 w-3.5" }), "Duplicate"]
|
|
700
|
+
}),
|
|
701
|
+
/* @__PURE__ */ A("button", {
|
|
702
|
+
role: "menuitem",
|
|
703
|
+
onClick: p,
|
|
532
704
|
className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-status-error-text hover:bg-bg-sunken",
|
|
533
|
-
children: [/* @__PURE__ */
|
|
705
|
+
children: [/* @__PURE__ */ k(E, { className: "h-3.5 w-3.5" }), "Delete"]
|
|
534
706
|
})
|
|
535
707
|
]
|
|
536
708
|
})]
|
|
537
|
-
})
|
|
538
|
-
}),
|
|
539
|
-
/* @__PURE__ */ P("div", {
|
|
540
|
-
className: "mb-4",
|
|
541
|
-
children: [/* @__PURE__ */ P("div", {
|
|
542
|
-
className: "mb-1 flex items-center justify-between text-xs",
|
|
543
|
-
children: [/* @__PURE__ */ P("span", {
|
|
544
|
-
className: "text-text-secondary",
|
|
545
|
-
children: [
|
|
546
|
-
"Budget: ",
|
|
547
|
-
o(e.budget.spent),
|
|
548
|
-
" /",
|
|
549
|
-
" ",
|
|
550
|
-
o(e.budget.total)
|
|
551
|
-
]
|
|
552
|
-
}), /* @__PURE__ */ P("span", {
|
|
553
|
-
className: "text-text-secondary",
|
|
554
|
-
children: [p.toFixed(0), "%"]
|
|
555
|
-
})]
|
|
556
|
-
}), /* @__PURE__ */ N("div", {
|
|
557
|
-
className: "h-2 w-full overflow-hidden rounded-full bg-bg-sunken",
|
|
558
|
-
children: /* @__PURE__ */ N("div", {
|
|
559
|
-
className: a("h-full rounded-full", p > 90 ? "bg-status-error-text" : p > 70 ? "bg-status-warning-text" : "bg-status-success-text"),
|
|
560
|
-
style: { width: `${Math.min(p, 100)}%` }
|
|
561
|
-
})
|
|
562
|
-
})]
|
|
563
|
-
}),
|
|
564
|
-
/* @__PURE__ */ P("div", {
|
|
565
|
-
className: "grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-6",
|
|
566
|
-
children: [
|
|
567
|
-
/* @__PURE__ */ P("div", {
|
|
568
|
-
className: "flex items-center gap-2",
|
|
569
|
-
children: [/* @__PURE__ */ N(b, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
570
|
-
className: "text-xs text-text-secondary",
|
|
571
|
-
children: "Spend"
|
|
572
|
-
}), /* @__PURE__ */ N("p", {
|
|
573
|
-
className: "text-sm font-medium text-text-primary",
|
|
574
|
-
children: o(e.metrics.spend)
|
|
575
|
-
})] })]
|
|
576
|
-
}),
|
|
577
|
-
/* @__PURE__ */ P("div", {
|
|
578
|
-
className: "flex items-center gap-2",
|
|
579
|
-
children: [/* @__PURE__ */ N(x, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
580
|
-
className: "text-xs text-text-secondary",
|
|
581
|
-
children: "Impressions"
|
|
582
|
-
}), /* @__PURE__ */ N("p", {
|
|
583
|
-
className: "text-sm font-medium text-text-primary",
|
|
584
|
-
children: s(e.metrics.impressions)
|
|
585
|
-
})] })]
|
|
586
|
-
}),
|
|
587
|
-
/* @__PURE__ */ P("div", {
|
|
588
|
-
className: "flex items-center gap-2",
|
|
589
|
-
children: [/* @__PURE__ */ N(C, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
590
|
-
className: "text-xs text-text-secondary",
|
|
591
|
-
children: "Clicks"
|
|
592
|
-
}), /* @__PURE__ */ N("p", {
|
|
593
|
-
className: "text-sm font-medium text-text-primary",
|
|
594
|
-
children: s(e.metrics.clicks)
|
|
595
|
-
})] })]
|
|
596
|
-
}),
|
|
597
|
-
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
598
|
-
className: "text-xs text-text-secondary",
|
|
599
|
-
children: "CTR"
|
|
600
|
-
}), /* @__PURE__ */ N("p", {
|
|
601
|
-
className: "text-sm font-medium text-text-primary",
|
|
602
|
-
children: c(e.metrics.ctr)
|
|
603
|
-
})] }),
|
|
604
|
-
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
605
|
-
className: "text-xs text-text-secondary",
|
|
606
|
-
children: "CPC"
|
|
607
|
-
}), /* @__PURE__ */ P("p", {
|
|
608
|
-
className: "text-sm font-medium text-text-primary",
|
|
609
|
-
children: ["$", e.metrics.cpc.toFixed(2)]
|
|
610
|
-
})] }),
|
|
611
|
-
/* @__PURE__ */ P("div", {
|
|
612
|
-
className: "flex items-center gap-2",
|
|
613
|
-
children: [/* @__PURE__ */ N(A, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
614
|
-
className: "text-xs text-text-secondary",
|
|
615
|
-
children: "ROAS"
|
|
616
|
-
}), /* @__PURE__ */ P("p", {
|
|
617
|
-
className: "text-sm font-medium text-text-primary",
|
|
618
|
-
children: [e.metrics.roas.toFixed(1), "x"]
|
|
619
|
-
})] })]
|
|
620
|
-
})
|
|
621
|
-
]
|
|
709
|
+
})
|
|
622
710
|
})
|
|
623
711
|
]
|
|
624
712
|
});
|
|
625
713
|
};
|
|
626
714
|
//#endregion
|
|
627
|
-
export {
|
|
715
|
+
export { M as AdCampaignsPage };
|
|
628
716
|
|
|
629
717
|
//# sourceMappingURL=AdCampaignsPage.js.map
|