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