@burdenoff/microfe-headshotmarketing 2026.703.1 → 2026.704.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.js +960 -77
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.js +26 -10
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/headshotmarketing/HeadshotMarketingRoot.js +45 -44
- package/dist/headshotmarketing/HeadshotMarketingRoot.js.map +1 -1
- package/dist/headshotmarketing/HeadshotMarketingRoutes.js +20 -0
- package/dist/headshotmarketing/HeadshotMarketingRoutes.js.map +1 -1
- package/dist/headshotmarketing/components/ActionMenu.js +57 -0
- package/dist/headshotmarketing/components/ActionMenu.js.map +1 -0
- package/dist/headshotmarketing/components/AssetUploadButton.js +47 -0
- package/dist/headshotmarketing/components/AssetUploadButton.js.map +1 -0
- package/dist/headshotmarketing/components/FilterBar.js.map +1 -1
- package/dist/headshotmarketing/components/InfluencerModals.js +606 -0
- package/dist/headshotmarketing/components/InfluencerModals.js.map +1 -0
- package/dist/headshotmarketing/components/LoadingSkeleton.js +11 -1
- package/dist/headshotmarketing/components/LoadingSkeleton.js.map +1 -0
- package/dist/headshotmarketing/components/Modal.js +6 -3
- package/dist/headshotmarketing/components/Modal.js.map +1 -1
- package/dist/headshotmarketing/components/Pagination.js +117 -0
- package/dist/headshotmarketing/components/Pagination.js.map +1 -0
- package/dist/headshotmarketing/components/QueryStateBoundary.js +46 -0
- package/dist/headshotmarketing/components/QueryStateBoundary.js.map +1 -0
- package/dist/headshotmarketing/components/StatusBadge.js.map +1 -1
- package/dist/headshotmarketing/components/TagChipsInput.js +74 -0
- package/dist/headshotmarketing/components/TagChipsInput.js.map +1 -0
- package/dist/headshotmarketing/components/index.js +6 -0
- package/dist/headshotmarketing/context/HeadshotMarketingContext.js +26 -22
- package/dist/headshotmarketing/context/HeadshotMarketingContext.js.map +1 -1
- package/dist/headshotmarketing/context/HeadshotmarketingBootstrapContext.js +29 -0
- package/dist/headshotmarketing/context/HeadshotmarketingBootstrapContext.js.map +1 -0
- package/dist/headshotmarketing/hooks/index.js +4 -0
- package/dist/headshotmarketing/hooks/useAssetUpload.js +86 -0
- package/dist/headshotmarketing/hooks/useAssetUpload.js.map +1 -0
- package/dist/headshotmarketing/hooks/useHeadshotmarketingBootstrap.js +12 -0
- package/dist/headshotmarketing/hooks/useHeadshotmarketingBootstrap.js.map +1 -0
- package/dist/headshotmarketing/hooks/usePagination.js +53 -0
- package/dist/headshotmarketing/hooks/usePagination.js.map +1 -0
- package/dist/headshotmarketing/pages/HomePage.js +334 -301
- package/dist/headshotmarketing/pages/HomePage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js +522 -225
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js +749 -147
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdsPage.js +197 -188
- package/dist/headshotmarketing/pages/ads/AdsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AudiencesPage.js +583 -147
- package/dist/headshotmarketing/pages/ads/AudiencesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js +218 -206
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/AdAnalyticsPage.js +244 -237
- package/dist/headshotmarketing/pages/analytics/AdAnalyticsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/AnalyticsPage.js +278 -272
- package/dist/headshotmarketing/pages/analytics/AnalyticsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/CampaignAnalyticsPage.js +197 -193
- package/dist/headshotmarketing/pages/analytics/CampaignAnalyticsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js +254 -295
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/SocialAnalyticsPage.js +221 -211
- package/dist/headshotmarketing/pages/analytics/SocialAnalyticsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/AutomationPage.js +239 -168
- package/dist/headshotmarketing/pages/automation/AutomationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/TriggersPage.js +150 -102
- package/dist/headshotmarketing/pages/automation/TriggersPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowActions.js +287 -0
- package/dist/headshotmarketing/pages/automation/WorkflowActions.js.map +1 -0
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js +56 -58
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.js +211 -179
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js +444 -306
- package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js +290 -217
- package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js +189 -151
- package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js +417 -274
- package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js +345 -260
- package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/AIToolsPage.js +261 -192
- package/dist/headshotmarketing/pages/content/AIToolsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/AssetLibraryPage.js +213 -141
- package/dist/headshotmarketing/pages/content/AssetLibraryPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentAnalyticsPage.js +242 -246
- package/dist/headshotmarketing/pages/content/ContentAnalyticsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js +184 -136
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentPage.js +208 -159
- package/dist/headshotmarketing/pages/content/ContentPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/ContactsPage.js +336 -265
- package/dist/headshotmarketing/pages/crm/ContactsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CreateContactPage.js +76 -87
- package/dist/headshotmarketing/pages/crm/CreateContactPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CreateDealPage.js +195 -196
- package/dist/headshotmarketing/pages/crm/CreateDealPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CrmActions.js +663 -0
- package/dist/headshotmarketing/pages/crm/CrmActions.js.map +1 -0
- package/dist/headshotmarketing/pages/crm/CrmPage.js +237 -207
- package/dist/headshotmarketing/pages/crm/CrmPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/LeadsPage.js +168 -165
- package/dist/headshotmarketing/pages/crm/LeadsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/PipelinePage.js +189 -178
- package/dist/headshotmarketing/pages/crm/PipelinePage.js.map +1 -1
- package/dist/headshotmarketing/pages/events/CreateEventPage.js +188 -190
- package/dist/headshotmarketing/pages/events/CreateEventPage.js.map +1 -1
- package/dist/headshotmarketing/pages/events/EventsPage.js +256 -238
- package/dist/headshotmarketing/pages/events/EventsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencerCampaignsPage.js +195 -167
- package/dist/headshotmarketing/pages/influencers/InfluencerCampaignsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js +280 -243
- package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencersPage.js +186 -183
- package/dist/headshotmarketing/pages/influencers/InfluencersPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js +303 -231
- package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/seo/SeoToolsPage.js +460 -310
- package/dist/headshotmarketing/pages/seo/SeoToolsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/AccountsPage.js +318 -104
- package/dist/headshotmarketing/pages/social-media/AccountsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/ContentCalendarPage.js +266 -255
- package/dist/headshotmarketing/pages/social-media/ContentCalendarPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/PostsPage.js +365 -202
- package/dist/headshotmarketing/pages/social-media/PostsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js +321 -233
- package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js +324 -308
- package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js.map +1 -1
- package/dist/headshotmarketing/utils/adsMapper.js +74 -51
- package/dist/headshotmarketing/utils/adsMapper.js.map +1 -1
- package/dist/headshotmarketing/utils/helpers.js +11 -1
- package/dist/headshotmarketing/utils/helpers.js.map +1 -1
- package/dist/headshotmarketing/utils/influencerMapper.js +1 -0
- package/dist/headshotmarketing/utils/influencerMapper.js.map +1 -1
- package/package.json +1 -1
- package/dist/headshotmarketing/utils/reportMapper.js +0 -33
- package/dist/headshotmarketing/utils/reportMapper.js.map +0 -1
|
@@ -1,237 +1,839 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { toAdCreativeModel as
|
|
5
|
-
import { PageLayout as
|
|
6
|
-
import { StatusBadge as
|
|
7
|
-
import { EmptyState as
|
|
8
|
-
import { FilterBar as
|
|
1
|
+
import { useCreateHeadshotmarketingAdCreativeMutation as e, useDeleteHeadshotmarketingAdCreativeMutation as t, useHeadshotmarketingAdCreativesListQuery as n, useUpdateHeadshotmarketingAdCreativeMutation as r } from "../../../generated/wspace-operations.js";
|
|
2
|
+
import { cn as i, formatNumber as a, formatPercentage as o } from "../../utils/helpers.js";
|
|
3
|
+
import { HeadshotmarketingAdCreativeStatus as s, HeadshotmarketingAdCreativeType as c } from "../../../generated/wspace-types.js";
|
|
4
|
+
import { toAdCreativeModel as l } from "../../utils/adsMapper.js";
|
|
5
|
+
import { PageLayout as ee } from "../../components/PageLayout.js";
|
|
6
|
+
import { StatusBadge as te } from "../../components/StatusBadge.js";
|
|
7
|
+
import { EmptyState as ne } from "../../components/EmptyState.js";
|
|
8
|
+
import { FilterBar as re } from "../../components/FilterBar.js";
|
|
9
|
+
import { Modal as u } from "../../components/Modal.js";
|
|
10
|
+
import { QueryStateBoundary as ie } from "../../components/QueryStateBoundary.js";
|
|
11
|
+
import { Pagination as ae } from "../../components/Pagination.js";
|
|
9
12
|
import "../../components/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
13
|
+
import { useHeadshotmarketingBootstrap as oe } from "../../hooks/useHeadshotmarketingBootstrap.js";
|
|
14
|
+
import { usePagination as se } from "../../hooks/usePagination.js";
|
|
15
|
+
import { useEffect as d, useMemo as f, useRef as ce, useState as p } from "react";
|
|
16
|
+
import { ExternalLink as le, Eye as m, Image as h, Layers as g, MoreHorizontal as _, Pencil as v, Plus as ue, Smartphone as y, Trash2 as de, Type as b, UploadCloud as fe, Video as x } from "lucide-react";
|
|
17
|
+
import { useExclusiveMenu as S } from "@burdenoff/fe-libs/shared/hooks";
|
|
18
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
19
|
+
import { EmphasisPanel as pe, PagePurpose as me } from "@burdenoff/fe-libs/ui";
|
|
20
|
+
import { useSaveToFiles as he } from "@burdenoff/fe-libs/storage";
|
|
14
21
|
//#region src/headshotmarketing/pages/ads/AdCreativesPage.tsx
|
|
15
|
-
var
|
|
16
|
-
image:
|
|
17
|
-
video:
|
|
18
|
-
carousel:
|
|
19
|
-
text:
|
|
20
|
-
responsive:
|
|
21
|
-
},
|
|
22
|
+
var ge = {
|
|
23
|
+
image: h,
|
|
24
|
+
video: x,
|
|
25
|
+
carousel: g,
|
|
26
|
+
text: b,
|
|
27
|
+
responsive: y
|
|
28
|
+
}, _e = {
|
|
22
29
|
image: "bg-status-info-bg text-status-info-text",
|
|
23
30
|
video: "bg-[var(--color-accent-soft)] text-action-primary-bg",
|
|
24
31
|
carousel: "bg-status-warning-bg text-status-warning-text",
|
|
25
32
|
text: "bg-bg-sunken text-text-secondary",
|
|
26
33
|
responsive: "bg-status-success-bg text-status-success-text"
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
}, E = {
|
|
35
|
+
image: c.Image,
|
|
36
|
+
video: c.Video,
|
|
37
|
+
carousel: c.Carousel,
|
|
38
|
+
text: c.Text,
|
|
39
|
+
responsive: c.Responsive
|
|
40
|
+
}, D = {
|
|
41
|
+
active: s.Active,
|
|
42
|
+
paused: s.Paused,
|
|
43
|
+
pending_review: s.PendingReview,
|
|
44
|
+
rejected: s.Rejected
|
|
45
|
+
};
|
|
46
|
+
function O(e) {
|
|
47
|
+
return E[e] ?? c.Image;
|
|
48
|
+
}
|
|
49
|
+
function ve(e) {
|
|
50
|
+
return D[e] ?? s.PendingReview;
|
|
51
|
+
}
|
|
52
|
+
function ye(e) {
|
|
53
|
+
return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : "text";
|
|
54
|
+
}
|
|
55
|
+
var k = {
|
|
56
|
+
name: "",
|
|
57
|
+
type: "image",
|
|
58
|
+
headline: "",
|
|
59
|
+
body: "",
|
|
60
|
+
callToAction: "Learn More",
|
|
61
|
+
destinationUrl: "",
|
|
62
|
+
status: "pending_review"
|
|
63
|
+
}, A = () => {
|
|
64
|
+
let { data: s, refetch: c } = oe(), [m, g] = p(""), [_, v] = p(""), [y, de] = p("all"), [b, x] = p("all"), [S, A] = p(null), [M, xe] = p(!1), [N, P] = p(k), [F, I] = p(null), [L, R] = p(null), [z, B] = p(null), [V, H] = p(null), [U, W] = p(null), [G, K] = p(null), q = ce(null), J = se({ initialPageSize: 12 }), { limit: Se, offset: Ce, setPage: we, setTotal: Te } = J;
|
|
65
|
+
d(() => {
|
|
66
|
+
let e = setTimeout(() => v(m), 300);
|
|
67
|
+
return () => clearTimeout(e);
|
|
68
|
+
}, [m]), d(() => {
|
|
69
|
+
we(1);
|
|
38
70
|
}, [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
])
|
|
44
|
-
|
|
71
|
+
_,
|
|
72
|
+
y,
|
|
73
|
+
b,
|
|
74
|
+
we
|
|
75
|
+
]);
|
|
76
|
+
let { data: Y, loading: Ee, error: De, refetch: Oe } = n({
|
|
77
|
+
variables: {
|
|
78
|
+
limit: Se,
|
|
79
|
+
offset: Ce,
|
|
80
|
+
search: _ || null,
|
|
81
|
+
status: D[b] ?? null,
|
|
82
|
+
type: E[y] ?? null
|
|
83
|
+
},
|
|
84
|
+
errorPolicy: "all",
|
|
85
|
+
notifyOnNetworkStatusChange: !0
|
|
86
|
+
}), X = Y?.headshotmarketingAdCreatives.total ?? 0;
|
|
87
|
+
d(() => {
|
|
88
|
+
Te(X);
|
|
89
|
+
}, [X, Te]);
|
|
90
|
+
let ke = f(() => (Y?.headshotmarketingAdCreatives.items ?? []).map((e) => l(e)), [Y?.headshotmarketingAdCreatives.items]), Z = f(() => {
|
|
91
|
+
let e = (s?.headshotmarketingAdCreatives.items ?? []).map((e) => l(e)), t = e.filter((e) => e.status === "active").length, n = e.reduce((e, t) => e + t.performance.impressions, 0), r = e.filter((e) => e.performance.impressions > 0), i = r.length > 0 ? r.reduce((e, t) => e + t.performance.ctr, 0) / r.length : 0;
|
|
45
92
|
return {
|
|
46
|
-
total:
|
|
47
|
-
active:
|
|
48
|
-
totalImpressions:
|
|
49
|
-
avgCtr:
|
|
93
|
+
total: e.length,
|
|
94
|
+
active: t,
|
|
95
|
+
totalImpressions: n,
|
|
96
|
+
avgCtr: i
|
|
50
97
|
};
|
|
51
|
-
}, [
|
|
52
|
-
|
|
98
|
+
}, [s?.headshotmarketingAdCreatives.items]), { save: Ae, isPending: je } = he(), [Me, { loading: Ne }] = e(), [Pe, { loading: Fe }] = r(), [Ie, { loading: Le }] = t(), Q = async () => {
|
|
99
|
+
await Promise.all([Oe(), c()]);
|
|
100
|
+
}, $ = () => {
|
|
101
|
+
xe(!1), P(k), I(null), L && URL.revokeObjectURL(L), R(null), q.current && (q.current.value = "");
|
|
102
|
+
}, Re = () => {
|
|
103
|
+
K(null), P(k), I(null), R(null), xe(!0);
|
|
104
|
+
}, ze = (e) => {
|
|
105
|
+
if (L && URL.revokeObjectURL(L), !e) {
|
|
106
|
+
I(null), R(null);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
I(e), R(e.type.startsWith("image/") ? URL.createObjectURL(e) : null), P((t) => ({
|
|
110
|
+
...t,
|
|
111
|
+
name: t.name || e.name.replace(/\.[^.]+$/, ""),
|
|
112
|
+
type: ye(e.type)
|
|
113
|
+
}));
|
|
114
|
+
}, Be = async () => {
|
|
115
|
+
if (!N.name.trim()) {
|
|
116
|
+
K("Creative name is required.");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
K(null);
|
|
120
|
+
try {
|
|
121
|
+
let e = [], t = {};
|
|
122
|
+
if (F) {
|
|
123
|
+
let e = F, n = await Ae({
|
|
124
|
+
source: {
|
|
125
|
+
kind: "blob",
|
|
126
|
+
getBlob: async () => ({
|
|
127
|
+
blob: e,
|
|
128
|
+
filename: e.name,
|
|
129
|
+
mimeType: e.type || "application/octet-stream"
|
|
130
|
+
}),
|
|
131
|
+
filename: e.name,
|
|
132
|
+
mimeType: e.type || "application/octet-stream"
|
|
133
|
+
},
|
|
134
|
+
folderPath: "/Headshotmarketing/Ad Creatives"
|
|
135
|
+
});
|
|
136
|
+
t.fileId = n.id, t.fileName = n.name;
|
|
137
|
+
}
|
|
138
|
+
await Me({ variables: { input: {
|
|
139
|
+
name: N.name.trim(),
|
|
140
|
+
type: O(N.type),
|
|
141
|
+
headline: N.headline || null,
|
|
142
|
+
body: N.body || null,
|
|
143
|
+
callToAction: N.callToAction || null,
|
|
144
|
+
destinationUrl: N.destinationUrl || null,
|
|
145
|
+
mediaUrls: e,
|
|
146
|
+
metadata: Object.keys(t).length > 0 ? t : null
|
|
147
|
+
} } }), $(), await Q();
|
|
148
|
+
} catch (e) {
|
|
149
|
+
K(e instanceof Error ? e.message : "Failed to upload creative.");
|
|
150
|
+
}
|
|
151
|
+
}, Ve = (e) => {
|
|
152
|
+
A(null), K(null), B({
|
|
153
|
+
id: e.id,
|
|
154
|
+
form: {
|
|
155
|
+
name: e.name,
|
|
156
|
+
type: e.type,
|
|
157
|
+
headline: e.headline,
|
|
158
|
+
body: e.description,
|
|
159
|
+
callToAction: e.callToAction,
|
|
160
|
+
destinationUrl: e.landingPageUrl,
|
|
161
|
+
status: e.status
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}, He = async () => {
|
|
165
|
+
if (z) {
|
|
166
|
+
if (!z.form.name.trim()) {
|
|
167
|
+
K("Creative name is required.");
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
K(null);
|
|
171
|
+
try {
|
|
172
|
+
await Pe({ variables: {
|
|
173
|
+
id: z.id,
|
|
174
|
+
input: {
|
|
175
|
+
name: z.form.name.trim(),
|
|
176
|
+
type: O(z.form.type),
|
|
177
|
+
headline: z.form.headline || null,
|
|
178
|
+
body: z.form.body || null,
|
|
179
|
+
callToAction: z.form.callToAction || null,
|
|
180
|
+
destinationUrl: z.form.destinationUrl || null,
|
|
181
|
+
status: ve(z.form.status)
|
|
182
|
+
}
|
|
183
|
+
} }), B(null), await Q();
|
|
184
|
+
} catch (e) {
|
|
185
|
+
K(e instanceof Error ? e.message : "Failed to save creative.");
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}, Ue = async () => {
|
|
189
|
+
if (U) {
|
|
190
|
+
K(null);
|
|
191
|
+
try {
|
|
192
|
+
await Ie({ variables: { id: U.id } }), W(null), await Q();
|
|
193
|
+
} catch (e) {
|
|
194
|
+
K(e instanceof Error ? e.message : "Failed to delete creative.");
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}, We = je || Ne;
|
|
198
|
+
return /* @__PURE__ */ T(ee, {
|
|
53
199
|
title: "Ad Creatives",
|
|
54
200
|
description: "Manage your advertising creative assets",
|
|
55
|
-
actions: /* @__PURE__ */
|
|
201
|
+
actions: /* @__PURE__ */ T("button", {
|
|
202
|
+
onClick: Re,
|
|
56
203
|
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",
|
|
57
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ w(ue, { className: "h-4 w-4" }), "Upload Creative"]
|
|
58
205
|
}),
|
|
59
206
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ w(me, { children: "Your library of ad creatives — images, videos, carousels and copy. Keep every asset and its real performance (impressions, CTR) in one place so you can quickly see what's resonating and reuse your best creative across campaigns." }),
|
|
208
|
+
/* @__PURE__ */ w(pe, { children: /* @__PURE__ */ T("div", {
|
|
62
209
|
className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
|
|
63
210
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
|
|
65
212
|
className: "text-xs text-text-secondary",
|
|
66
213
|
children: "Total Creatives"
|
|
67
|
-
}), /* @__PURE__ */
|
|
214
|
+
}), /* @__PURE__ */ w("p", {
|
|
68
215
|
className: "text-2xl font-semibold text-text-primary",
|
|
69
|
-
children:
|
|
216
|
+
children: a(Z.total)
|
|
70
217
|
})] }),
|
|
71
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
|
|
72
219
|
className: "text-xs text-text-secondary",
|
|
73
220
|
children: "Active"
|
|
74
|
-
}), /* @__PURE__ */
|
|
221
|
+
}), /* @__PURE__ */ w("p", {
|
|
75
222
|
className: "text-2xl font-semibold text-text-primary",
|
|
76
|
-
children:
|
|
223
|
+
children: a(Z.active)
|
|
77
224
|
})] }),
|
|
78
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
|
|
79
226
|
className: "text-xs text-text-secondary",
|
|
80
227
|
children: "Impressions"
|
|
81
|
-
}), /* @__PURE__ */
|
|
228
|
+
}), /* @__PURE__ */ w("p", {
|
|
82
229
|
className: "text-2xl font-semibold text-text-primary",
|
|
83
|
-
children:
|
|
230
|
+
children: a(Z.totalImpressions)
|
|
84
231
|
})] }),
|
|
85
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
|
|
86
233
|
className: "text-xs text-text-secondary",
|
|
87
234
|
children: "Avg CTR"
|
|
88
|
-
}), /* @__PURE__ */
|
|
235
|
+
}), /* @__PURE__ */ w("p", {
|
|
89
236
|
className: "text-2xl font-semibold text-text-primary",
|
|
90
|
-
children:
|
|
237
|
+
children: o(Z.avgCtr)
|
|
91
238
|
})] })
|
|
92
239
|
]
|
|
93
240
|
}) }),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
searchValue:
|
|
96
|
-
onSearchChange:
|
|
241
|
+
/* @__PURE__ */ w(re, {
|
|
242
|
+
searchValue: m,
|
|
243
|
+
onSearchChange: g,
|
|
97
244
|
searchPlaceholder: "Search creatives...",
|
|
98
|
-
filters: /* @__PURE__ */
|
|
99
|
-
value:
|
|
100
|
-
onChange: (e) =>
|
|
245
|
+
filters: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ T("select", {
|
|
246
|
+
value: y,
|
|
247
|
+
onChange: (e) => de(e.target.value),
|
|
101
248
|
className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
|
|
102
249
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ w("option", {
|
|
104
251
|
value: "all",
|
|
105
252
|
children: "All Types"
|
|
106
253
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ w("option", {
|
|
108
255
|
value: "image",
|
|
109
256
|
children: "Image"
|
|
110
257
|
}),
|
|
111
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ w("option", {
|
|
112
259
|
value: "video",
|
|
113
260
|
children: "Video"
|
|
114
261
|
}),
|
|
115
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ w("option", {
|
|
116
263
|
value: "carousel",
|
|
117
264
|
children: "Carousel"
|
|
118
265
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ w("option", {
|
|
120
267
|
value: "text",
|
|
121
268
|
children: "Text"
|
|
122
269
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ w("option", {
|
|
124
271
|
value: "responsive",
|
|
125
272
|
children: "Responsive"
|
|
126
273
|
})
|
|
127
274
|
]
|
|
128
|
-
}), /* @__PURE__ */
|
|
129
|
-
value:
|
|
130
|
-
onChange: (e) =>
|
|
275
|
+
}), /* @__PURE__ */ T("select", {
|
|
276
|
+
value: b,
|
|
277
|
+
onChange: (e) => x(e.target.value),
|
|
131
278
|
className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
|
|
132
279
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ w("option", {
|
|
134
281
|
value: "all",
|
|
135
282
|
children: "All Status"
|
|
136
283
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ w("option", {
|
|
138
285
|
value: "active",
|
|
139
286
|
children: "Active"
|
|
140
287
|
}),
|
|
141
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ w("option", {
|
|
142
289
|
value: "paused",
|
|
143
290
|
children: "Paused"
|
|
144
291
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ w("option", {
|
|
146
293
|
value: "pending_review",
|
|
147
294
|
children: "Pending Review"
|
|
148
295
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ w("option", {
|
|
150
297
|
value: "rejected",
|
|
151
298
|
children: "Rejected"
|
|
152
299
|
})
|
|
153
300
|
]
|
|
154
301
|
})] })
|
|
155
302
|
}),
|
|
156
|
-
M
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
action: j.length === 0 ? /* @__PURE__ */ S("button", {
|
|
161
|
-
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",
|
|
162
|
-
children: [/* @__PURE__ */ x(g, { className: "h-4 w-4" }), "Upload Creative"]
|
|
163
|
-
}) : void 0
|
|
303
|
+
G && !M && !z && /* @__PURE__ */ w("div", {
|
|
304
|
+
role: "alert",
|
|
305
|
+
className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
|
|
306
|
+
children: G
|
|
164
307
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
className: "
|
|
177
|
-
children: [
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
308
|
+
/* @__PURE__ */ w(ie, {
|
|
309
|
+
loading: Ee,
|
|
310
|
+
error: De,
|
|
311
|
+
onRetry: Oe,
|
|
312
|
+
hasData: !!Y,
|
|
313
|
+
children: ke.length === 0 ? /* @__PURE__ */ w(ne, {
|
|
314
|
+
illustration: X === 0 ? "empty-files" : "empty-search",
|
|
315
|
+
title: X === 0 ? "No creatives yet" : "No creatives match your filters",
|
|
316
|
+
description: X === 0 ? "Upload images, videos or copy to build your ad creative library." : "Try a different search term, type or status.",
|
|
317
|
+
action: X === 0 ? /* @__PURE__ */ T("button", {
|
|
318
|
+
onClick: Re,
|
|
319
|
+
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",
|
|
320
|
+
children: [/* @__PURE__ */ w(ue, { className: "h-4 w-4" }), "Upload Creative"]
|
|
321
|
+
}) : void 0
|
|
322
|
+
}) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("div", {
|
|
323
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
324
|
+
children: ke.map((e) => /* @__PURE__ */ w(be, {
|
|
325
|
+
creative: e,
|
|
326
|
+
menuOpen: S === e.id,
|
|
327
|
+
onToggleMenu: () => A(S === e.id ? null : e.id),
|
|
328
|
+
onCloseMenu: () => A(null),
|
|
329
|
+
onPreview: () => H(e),
|
|
330
|
+
onEdit: () => Ve(e),
|
|
331
|
+
onDelete: () => {
|
|
332
|
+
A(null), W(e);
|
|
333
|
+
}
|
|
334
|
+
}, e.id))
|
|
335
|
+
}), /* @__PURE__ */ w(ae, {
|
|
336
|
+
page: J.page,
|
|
337
|
+
pageSize: J.pageSize,
|
|
338
|
+
total: J.total,
|
|
339
|
+
onPageChange: J.setPage,
|
|
340
|
+
onPageSizeChange: J.setPageSize,
|
|
341
|
+
pageSizeOptions: [
|
|
342
|
+
12,
|
|
343
|
+
24,
|
|
344
|
+
48
|
|
345
|
+
],
|
|
346
|
+
disabled: Ee,
|
|
347
|
+
hideWhenSinglePage: !0
|
|
348
|
+
})] })
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ w(u, {
|
|
351
|
+
open: M,
|
|
352
|
+
onClose: $,
|
|
353
|
+
title: "Upload Creative",
|
|
354
|
+
description: "Add a new creative asset to your library",
|
|
355
|
+
size: "lg",
|
|
356
|
+
footer: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("button", {
|
|
357
|
+
onClick: $,
|
|
358
|
+
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
359
|
+
children: "Cancel"
|
|
360
|
+
}), /* @__PURE__ */ w("button", {
|
|
361
|
+
onClick: Be,
|
|
362
|
+
disabled: We,
|
|
363
|
+
className: "rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90 disabled:opacity-60",
|
|
364
|
+
children: We ? "Uploading..." : "Upload Creative"
|
|
365
|
+
})] }),
|
|
366
|
+
children: /* @__PURE__ */ T("div", {
|
|
367
|
+
className: "space-y-4",
|
|
368
|
+
children: [
|
|
369
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("input", {
|
|
370
|
+
ref: q,
|
|
371
|
+
type: "file",
|
|
372
|
+
accept: "image/*,video/*",
|
|
373
|
+
className: "sr-only",
|
|
374
|
+
onChange: (e) => ze(e.target.files?.[0] ?? null)
|
|
375
|
+
}), /* @__PURE__ */ T("button", {
|
|
376
|
+
type: "button",
|
|
377
|
+
onClick: () => q.current?.click(),
|
|
378
|
+
className: "flex w-full flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border-subtle bg-bg-sunken/40 px-4 py-6 text-center transition-colors hover:border-foreground/40",
|
|
379
|
+
children: [
|
|
380
|
+
L ? /* @__PURE__ */ w("img", {
|
|
381
|
+
src: L,
|
|
382
|
+
alt: "Selected creative preview",
|
|
383
|
+
className: "max-h-40 rounded-md object-contain"
|
|
384
|
+
}) : /* @__PURE__ */ w(fe, { className: "h-8 w-8 text-text-secondary" }),
|
|
385
|
+
/* @__PURE__ */ w("span", {
|
|
386
|
+
className: "text-sm font-medium text-text-primary",
|
|
387
|
+
children: F ? F.name : "Click to select a file"
|
|
388
|
+
}),
|
|
389
|
+
/* @__PURE__ */ w("span", {
|
|
191
390
|
className: "text-xs text-text-secondary",
|
|
192
|
-
children:
|
|
193
|
-
})
|
|
391
|
+
children: "Images or video — stored securely in Files"
|
|
392
|
+
})
|
|
393
|
+
]
|
|
394
|
+
})] }),
|
|
395
|
+
/* @__PURE__ */ T("div", {
|
|
396
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
397
|
+
children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
398
|
+
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
399
|
+
children: "Name"
|
|
400
|
+
}), /* @__PURE__ */ w("input", {
|
|
401
|
+
type: "text",
|
|
402
|
+
value: N.name,
|
|
403
|
+
onChange: (e) => P({
|
|
404
|
+
...N,
|
|
405
|
+
name: e.target.value
|
|
406
|
+
}),
|
|
407
|
+
placeholder: "e.g., Spring Promo Hero",
|
|
408
|
+
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)]"
|
|
409
|
+
})] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
410
|
+
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
411
|
+
children: "Type"
|
|
412
|
+
}), /* @__PURE__ */ T("select", {
|
|
413
|
+
value: N.type,
|
|
414
|
+
onChange: (e) => P({
|
|
415
|
+
...N,
|
|
416
|
+
type: e.target.value
|
|
417
|
+
}),
|
|
418
|
+
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)]",
|
|
419
|
+
children: [
|
|
420
|
+
/* @__PURE__ */ w("option", {
|
|
421
|
+
value: "image",
|
|
422
|
+
children: "Image"
|
|
423
|
+
}),
|
|
424
|
+
/* @__PURE__ */ w("option", {
|
|
425
|
+
value: "video",
|
|
426
|
+
children: "Video"
|
|
427
|
+
}),
|
|
428
|
+
/* @__PURE__ */ w("option", {
|
|
429
|
+
value: "carousel",
|
|
430
|
+
children: "Carousel"
|
|
431
|
+
}),
|
|
432
|
+
/* @__PURE__ */ w("option", {
|
|
433
|
+
value: "text",
|
|
434
|
+
children: "Text"
|
|
435
|
+
}),
|
|
436
|
+
/* @__PURE__ */ w("option", {
|
|
437
|
+
value: "responsive",
|
|
438
|
+
children: "Responsive"
|
|
439
|
+
})
|
|
440
|
+
]
|
|
441
|
+
})] })]
|
|
442
|
+
}),
|
|
443
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
444
|
+
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
445
|
+
children: "Headline"
|
|
446
|
+
}), /* @__PURE__ */ w("input", {
|
|
447
|
+
type: "text",
|
|
448
|
+
value: N.headline,
|
|
449
|
+
onChange: (e) => P({
|
|
450
|
+
...N,
|
|
451
|
+
headline: e.target.value
|
|
194
452
|
}),
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
453
|
+
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)]"
|
|
454
|
+
})] }),
|
|
455
|
+
/* @__PURE__ */ T("div", {
|
|
456
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
457
|
+
children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
458
|
+
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
459
|
+
children: "Call to Action"
|
|
460
|
+
}), /* @__PURE__ */ w("input", {
|
|
461
|
+
type: "text",
|
|
462
|
+
value: N.callToAction,
|
|
463
|
+
onChange: (e) => P({
|
|
464
|
+
...N,
|
|
465
|
+
callToAction: e.target.value
|
|
466
|
+
}),
|
|
467
|
+
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)]"
|
|
468
|
+
})] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
469
|
+
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
470
|
+
children: "Destination URL"
|
|
471
|
+
}), /* @__PURE__ */ w("input", {
|
|
472
|
+
type: "url",
|
|
473
|
+
value: N.destinationUrl,
|
|
474
|
+
onChange: (e) => P({
|
|
475
|
+
...N,
|
|
476
|
+
destinationUrl: e.target.value
|
|
477
|
+
}),
|
|
478
|
+
placeholder: "https://",
|
|
479
|
+
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)]"
|
|
480
|
+
})] })]
|
|
481
|
+
}),
|
|
482
|
+
G && /* @__PURE__ */ w("p", {
|
|
483
|
+
className: "text-sm text-status-error-text",
|
|
484
|
+
children: G
|
|
485
|
+
})
|
|
486
|
+
]
|
|
487
|
+
})
|
|
488
|
+
}),
|
|
489
|
+
/* @__PURE__ */ w(u, {
|
|
490
|
+
open: z !== null,
|
|
491
|
+
onClose: () => B(null),
|
|
492
|
+
title: "Edit Creative",
|
|
493
|
+
size: "lg",
|
|
494
|
+
footer: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("button", {
|
|
495
|
+
onClick: () => B(null),
|
|
496
|
+
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
497
|
+
children: "Cancel"
|
|
498
|
+
}), /* @__PURE__ */ w("button", {
|
|
499
|
+
onClick: He,
|
|
500
|
+
disabled: Fe,
|
|
501
|
+
className: "rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90 disabled:opacity-60",
|
|
502
|
+
children: Fe ? "Saving..." : "Save Changes"
|
|
503
|
+
})] }),
|
|
504
|
+
children: z && /* @__PURE__ */ T("div", {
|
|
505
|
+
className: "space-y-4",
|
|
506
|
+
children: [
|
|
507
|
+
/* @__PURE__ */ T("div", {
|
|
508
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
509
|
+
children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
510
|
+
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
511
|
+
children: "Name"
|
|
512
|
+
}), /* @__PURE__ */ w("input", {
|
|
513
|
+
type: "text",
|
|
514
|
+
value: z.form.name,
|
|
515
|
+
onChange: (e) => B({
|
|
516
|
+
...z,
|
|
517
|
+
form: {
|
|
518
|
+
...z.form,
|
|
519
|
+
name: e.target.value
|
|
520
|
+
}
|
|
521
|
+
}),
|
|
522
|
+
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)]"
|
|
523
|
+
})] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
524
|
+
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
525
|
+
children: "Status"
|
|
526
|
+
}), /* @__PURE__ */ T("select", {
|
|
527
|
+
value: z.form.status,
|
|
528
|
+
onChange: (e) => B({
|
|
529
|
+
...z,
|
|
530
|
+
form: {
|
|
531
|
+
...z.form,
|
|
532
|
+
status: e.target.value
|
|
533
|
+
}
|
|
534
|
+
}),
|
|
535
|
+
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)]",
|
|
536
|
+
children: [
|
|
537
|
+
/* @__PURE__ */ w("option", {
|
|
538
|
+
value: "pending_review",
|
|
539
|
+
children: "Pending Review"
|
|
540
|
+
}),
|
|
541
|
+
/* @__PURE__ */ w("option", {
|
|
542
|
+
value: "active",
|
|
543
|
+
children: "Active"
|
|
544
|
+
}),
|
|
545
|
+
/* @__PURE__ */ w("option", {
|
|
546
|
+
value: "paused",
|
|
547
|
+
children: "Paused"
|
|
548
|
+
}),
|
|
549
|
+
/* @__PURE__ */ w("option", {
|
|
550
|
+
value: "rejected",
|
|
551
|
+
children: "Rejected"
|
|
552
|
+
})
|
|
553
|
+
]
|
|
554
|
+
})] })]
|
|
555
|
+
}),
|
|
556
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
557
|
+
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
558
|
+
children: "Headline"
|
|
559
|
+
}), /* @__PURE__ */ w("input", {
|
|
560
|
+
type: "text",
|
|
561
|
+
value: z.form.headline,
|
|
562
|
+
onChange: (e) => B({
|
|
563
|
+
...z,
|
|
564
|
+
form: {
|
|
565
|
+
...z.form,
|
|
566
|
+
headline: e.target.value
|
|
567
|
+
}
|
|
568
|
+
}),
|
|
569
|
+
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)]"
|
|
570
|
+
})] }),
|
|
571
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
572
|
+
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
573
|
+
children: "Body"
|
|
574
|
+
}), /* @__PURE__ */ w("textarea", {
|
|
575
|
+
value: z.form.body,
|
|
576
|
+
onChange: (e) => B({
|
|
577
|
+
...z,
|
|
578
|
+
form: {
|
|
579
|
+
...z.form,
|
|
580
|
+
body: e.target.value
|
|
581
|
+
}
|
|
216
582
|
}),
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
583
|
+
rows: 3,
|
|
584
|
+
className: "w-full resize-none 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)]"
|
|
585
|
+
})] }),
|
|
586
|
+
/* @__PURE__ */ T("div", {
|
|
587
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
588
|
+
children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
589
|
+
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
590
|
+
children: "Call to Action"
|
|
591
|
+
}), /* @__PURE__ */ w("input", {
|
|
592
|
+
type: "text",
|
|
593
|
+
value: z.form.callToAction,
|
|
594
|
+
onChange: (e) => B({
|
|
595
|
+
...z,
|
|
596
|
+
form: {
|
|
597
|
+
...z.form,
|
|
598
|
+
callToAction: e.target.value
|
|
599
|
+
}
|
|
600
|
+
}),
|
|
601
|
+
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)]"
|
|
602
|
+
})] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
603
|
+
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
604
|
+
children: "Destination URL"
|
|
605
|
+
}), /* @__PURE__ */ w("input", {
|
|
606
|
+
type: "url",
|
|
607
|
+
value: z.form.destinationUrl,
|
|
608
|
+
onChange: (e) => B({
|
|
609
|
+
...z,
|
|
610
|
+
form: {
|
|
611
|
+
...z.form,
|
|
612
|
+
destinationUrl: e.target.value
|
|
613
|
+
}
|
|
614
|
+
}),
|
|
615
|
+
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)]"
|
|
616
|
+
})] })]
|
|
617
|
+
}),
|
|
618
|
+
G && /* @__PURE__ */ w("p", {
|
|
619
|
+
className: "text-sm text-status-error-text",
|
|
620
|
+
children: G
|
|
621
|
+
})
|
|
622
|
+
]
|
|
623
|
+
})
|
|
624
|
+
}),
|
|
625
|
+
/* @__PURE__ */ w(u, {
|
|
626
|
+
open: V !== null,
|
|
627
|
+
onClose: () => H(null),
|
|
628
|
+
title: V?.name ?? "Creative Preview",
|
|
629
|
+
description: V?.headline,
|
|
630
|
+
size: "lg",
|
|
631
|
+
children: V && /* @__PURE__ */ T("div", {
|
|
632
|
+
className: "space-y-4",
|
|
633
|
+
children: [
|
|
634
|
+
/* @__PURE__ */ w("div", {
|
|
635
|
+
className: "flex min-h-[12rem] items-center justify-center rounded-lg border border-border-subtle bg-bg-sunken/40 p-4",
|
|
636
|
+
children: V.mediaUrl ? V.type === "video" ? /* @__PURE__ */ w("video", {
|
|
637
|
+
src: V.mediaUrl,
|
|
638
|
+
controls: !0,
|
|
639
|
+
className: "max-h-80 rounded-md"
|
|
640
|
+
}) : /* @__PURE__ */ w("img", {
|
|
641
|
+
src: V.mediaUrl,
|
|
642
|
+
alt: V.name,
|
|
643
|
+
className: "max-h-80 rounded-md object-contain"
|
|
644
|
+
}) : /* @__PURE__ */ T("div", {
|
|
645
|
+
className: "flex flex-col items-center gap-2 text-text-secondary",
|
|
646
|
+
children: [/* @__PURE__ */ w(ge[V.type] ?? h, { className: "h-12 w-12" }), /* @__PURE__ */ w("span", {
|
|
647
|
+
className: "text-xs",
|
|
648
|
+
children: "No media preview available"
|
|
225
649
|
})]
|
|
226
650
|
})
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
651
|
+
}),
|
|
652
|
+
/* @__PURE__ */ T("div", {
|
|
653
|
+
className: "flex flex-wrap items-center gap-2",
|
|
654
|
+
children: [
|
|
655
|
+
/* @__PURE__ */ w("span", {
|
|
656
|
+
className: i("rounded-full px-2.5 py-0.5 text-xs font-medium capitalize", _e[V.type]),
|
|
657
|
+
children: V.type
|
|
658
|
+
}),
|
|
659
|
+
/* @__PURE__ */ w(te, { status: V.status }),
|
|
660
|
+
V.callToAction && /* @__PURE__ */ T("span", {
|
|
661
|
+
className: "text-xs text-text-secondary",
|
|
662
|
+
children: ["CTA: ", V.callToAction]
|
|
663
|
+
})
|
|
664
|
+
]
|
|
665
|
+
}),
|
|
666
|
+
V.description && /* @__PURE__ */ w("p", {
|
|
667
|
+
className: "text-sm text-text-secondary",
|
|
668
|
+
children: V.description
|
|
669
|
+
}),
|
|
670
|
+
V.landingPageUrl && /* @__PURE__ */ T("a", {
|
|
671
|
+
href: V.landingPageUrl,
|
|
672
|
+
target: "_blank",
|
|
673
|
+
rel: "noreferrer",
|
|
674
|
+
className: "inline-flex items-center gap-1.5 text-sm text-action-primary-bg hover:underline",
|
|
675
|
+
children: [/* @__PURE__ */ w(le, { className: "h-3.5 w-3.5" }), V.landingPageUrl]
|
|
676
|
+
}),
|
|
677
|
+
V.performance.impressions > 0 && /* @__PURE__ */ T("div", {
|
|
678
|
+
className: "grid grid-cols-2 gap-3 sm:grid-cols-4",
|
|
679
|
+
children: [
|
|
680
|
+
/* @__PURE__ */ w(j, {
|
|
681
|
+
label: "Impressions",
|
|
682
|
+
value: a(V.performance.impressions)
|
|
683
|
+
}),
|
|
684
|
+
/* @__PURE__ */ w(j, {
|
|
685
|
+
label: "Clicks",
|
|
686
|
+
value: a(V.performance.clicks)
|
|
687
|
+
}),
|
|
688
|
+
/* @__PURE__ */ w(j, {
|
|
689
|
+
label: "CTR",
|
|
690
|
+
value: o(V.performance.ctr)
|
|
691
|
+
}),
|
|
692
|
+
/* @__PURE__ */ w(j, {
|
|
693
|
+
label: "Conversions",
|
|
694
|
+
value: a(V.performance.conversions)
|
|
695
|
+
})
|
|
696
|
+
]
|
|
697
|
+
})
|
|
698
|
+
]
|
|
699
|
+
})
|
|
700
|
+
}),
|
|
701
|
+
/* @__PURE__ */ w(u, {
|
|
702
|
+
open: U !== null,
|
|
703
|
+
onClose: () => W(null),
|
|
704
|
+
title: "Delete Creative",
|
|
705
|
+
size: "sm",
|
|
706
|
+
footer: /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("button", {
|
|
707
|
+
onClick: () => W(null),
|
|
708
|
+
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
709
|
+
children: "Cancel"
|
|
710
|
+
}), /* @__PURE__ */ w("button", {
|
|
711
|
+
onClick: Ue,
|
|
712
|
+
disabled: Le,
|
|
713
|
+
className: "rounded-md bg-status-error-text px-4 py-2 text-sm font-medium text-background hover:opacity-90 disabled:opacity-60",
|
|
714
|
+
children: Le ? "Deleting..." : "Delete"
|
|
715
|
+
})] }),
|
|
716
|
+
children: /* @__PURE__ */ T("p", {
|
|
717
|
+
className: "text-sm text-text-secondary",
|
|
718
|
+
children: [
|
|
719
|
+
"Are you sure you want to delete",
|
|
720
|
+
" ",
|
|
721
|
+
/* @__PURE__ */ w("span", {
|
|
722
|
+
className: "font-semibold text-text-primary",
|
|
723
|
+
children: U?.name
|
|
724
|
+
}),
|
|
725
|
+
"? This action cannot be undone."
|
|
726
|
+
]
|
|
727
|
+
})
|
|
230
728
|
})
|
|
231
729
|
]
|
|
232
730
|
});
|
|
731
|
+
}, j = ({ label: e, value: t }) => /* @__PURE__ */ T("div", {
|
|
732
|
+
className: "rounded-md bg-bg-sunken/50 py-2 text-center",
|
|
733
|
+
children: [/* @__PURE__ */ w("p", {
|
|
734
|
+
className: "text-sm font-bold text-text-primary",
|
|
735
|
+
children: t
|
|
736
|
+
}), /* @__PURE__ */ w("p", {
|
|
737
|
+
className: "text-[10px] text-text-secondary",
|
|
738
|
+
children: e
|
|
739
|
+
})]
|
|
740
|
+
}), be = ({ creative: e, menuOpen: t, onToggleMenu: n, onCloseMenu: r, onPreview: s, onEdit: c, onDelete: l }) => {
|
|
741
|
+
S(`ad-creative-${e.id}`, t, r);
|
|
742
|
+
let ee = ge[e.type] || h;
|
|
743
|
+
return /* @__PURE__ */ T("div", {
|
|
744
|
+
className: "overflow-hidden rounded-lg border border-border-seam bg-gloss-card shadow-pop transition-colors hover:border-foreground/30",
|
|
745
|
+
children: [/* @__PURE__ */ T("button", {
|
|
746
|
+
type: "button",
|
|
747
|
+
onClick: s,
|
|
748
|
+
"aria-label": `Preview ${e.name}`,
|
|
749
|
+
className: "relative flex h-40 w-full items-center justify-center bg-bg-sunken/50",
|
|
750
|
+
children: [e.mediaUrl && e.type === "image" ? /* @__PURE__ */ w("img", {
|
|
751
|
+
src: e.mediaUrl,
|
|
752
|
+
alt: e.name,
|
|
753
|
+
className: "h-full w-full object-cover"
|
|
754
|
+
}) : /* @__PURE__ */ w(ee, { className: "h-12 w-12 text-text-secondary/40" }), /* @__PURE__ */ w("div", {
|
|
755
|
+
className: "absolute right-2 top-2",
|
|
756
|
+
children: /* @__PURE__ */ w(te, { status: e.status })
|
|
757
|
+
})]
|
|
758
|
+
}), /* @__PURE__ */ T("div", {
|
|
759
|
+
className: "space-y-3 p-4",
|
|
760
|
+
children: [
|
|
761
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h3", {
|
|
762
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
763
|
+
children: e.name
|
|
764
|
+
}), /* @__PURE__ */ w("p", {
|
|
765
|
+
className: "mt-0.5 truncate text-xs text-text-secondary",
|
|
766
|
+
children: e.headline
|
|
767
|
+
})] }),
|
|
768
|
+
/* @__PURE__ */ T("div", {
|
|
769
|
+
className: "flex items-center gap-2",
|
|
770
|
+
children: [/* @__PURE__ */ w("span", {
|
|
771
|
+
className: i("rounded-full px-2 py-0.5 text-xs font-medium capitalize", _e[e.type]),
|
|
772
|
+
children: e.type
|
|
773
|
+
}), /* @__PURE__ */ w("span", {
|
|
774
|
+
className: "text-xs text-text-secondary",
|
|
775
|
+
children: e.callToAction
|
|
776
|
+
})]
|
|
777
|
+
}),
|
|
778
|
+
e.performance.impressions > 0 && /* @__PURE__ */ T("div", {
|
|
779
|
+
className: "grid grid-cols-2 gap-2 text-center",
|
|
780
|
+
children: [/* @__PURE__ */ T("div", {
|
|
781
|
+
className: "rounded-md bg-bg-sunken/50 py-1.5",
|
|
782
|
+
children: [/* @__PURE__ */ w("p", {
|
|
783
|
+
className: "text-xs font-bold text-text-primary",
|
|
784
|
+
children: a(e.performance.impressions)
|
|
785
|
+
}), /* @__PURE__ */ w("p", {
|
|
786
|
+
className: "text-[10px] text-text-secondary",
|
|
787
|
+
children: "Impressions"
|
|
788
|
+
})]
|
|
789
|
+
}), /* @__PURE__ */ T("div", {
|
|
790
|
+
className: "rounded-md bg-bg-sunken/50 py-1.5",
|
|
791
|
+
children: [/* @__PURE__ */ w("p", {
|
|
792
|
+
className: "text-xs font-bold text-text-primary",
|
|
793
|
+
children: o(e.performance.ctr)
|
|
794
|
+
}), /* @__PURE__ */ w("p", {
|
|
795
|
+
className: "text-[10px] text-text-secondary",
|
|
796
|
+
children: "CTR"
|
|
797
|
+
})]
|
|
798
|
+
})]
|
|
799
|
+
}),
|
|
800
|
+
/* @__PURE__ */ T("div", {
|
|
801
|
+
className: "flex items-center justify-between border-t border-border-subtle pt-2",
|
|
802
|
+
children: [/* @__PURE__ */ T("button", {
|
|
803
|
+
onClick: s,
|
|
804
|
+
className: "inline-flex items-center gap-1 text-xs text-text-secondary hover:text-text-primary",
|
|
805
|
+
children: [/* @__PURE__ */ w(m, { className: "h-3 w-3" }), "Preview"]
|
|
806
|
+
}), /* @__PURE__ */ T("div", {
|
|
807
|
+
className: "relative",
|
|
808
|
+
children: [/* @__PURE__ */ w("button", {
|
|
809
|
+
onClick: n,
|
|
810
|
+
"aria-haspopup": "menu",
|
|
811
|
+
"aria-expanded": t,
|
|
812
|
+
"aria-label": "Creative actions",
|
|
813
|
+
className: "text-text-secondary hover:text-text-primary",
|
|
814
|
+
children: /* @__PURE__ */ w(_, { className: "h-4 w-4" })
|
|
815
|
+
}), t && /* @__PURE__ */ T("div", {
|
|
816
|
+
role: "menu",
|
|
817
|
+
className: "absolute bottom-6 right-0 z-20 w-36 rounded-md border border-border-seam bg-gloss-card py-1 shadow-lg",
|
|
818
|
+
children: [/* @__PURE__ */ T("button", {
|
|
819
|
+
role: "menuitem",
|
|
820
|
+
onClick: c,
|
|
821
|
+
className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
|
|
822
|
+
children: [/* @__PURE__ */ w(v, { className: "h-3.5 w-3.5" }), "Edit"]
|
|
823
|
+
}), /* @__PURE__ */ T("button", {
|
|
824
|
+
role: "menuitem",
|
|
825
|
+
onClick: l,
|
|
826
|
+
className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-status-error-text hover:bg-bg-sunken",
|
|
827
|
+
children: [/* @__PURE__ */ w(de, { className: "h-3.5 w-3.5" }), "Delete"]
|
|
828
|
+
})]
|
|
829
|
+
})]
|
|
830
|
+
})]
|
|
831
|
+
})
|
|
832
|
+
]
|
|
833
|
+
})]
|
|
834
|
+
});
|
|
233
835
|
};
|
|
234
836
|
//#endregion
|
|
235
|
-
export {
|
|
837
|
+
export { A as AdCreativesPage };
|
|
236
838
|
|
|
237
839
|
//# sourceMappingURL=AdCreativesPage.js.map
|