@elevasis/ui 2.75.0 → 2.77.0
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/api/index.js +3 -3
- package/dist/app/index.d.ts +277 -249
- package/dist/app/index.js +12 -11
- package/dist/auth/context.d.ts +1 -2
- package/dist/auth/index.d.ts +1 -2
- package/dist/auth/index.js +6 -7
- package/dist/charts/index.js +6 -7
- package/dist/{chunk-CRPH5AAB.js → chunk-2GIHWU5O.js} +4 -3
- package/dist/chunk-2Y6AKWGU.js +42 -0
- package/dist/chunk-3QYRZSHP.js +854 -0
- package/dist/{chunk-L3NBMLRN.js → chunk-3RK2NNJX.js} +1 -1
- package/dist/{chunk-R6NMRXNO.js → chunk-4WLAVUPS.js} +1 -1
- package/dist/{chunk-DTEGVSJ6.js → chunk-5R4I2PAN.js} +9 -43
- package/dist/chunk-6B4ZPBQJ.js +7 -0
- package/dist/{chunk-QFS2GZMV.js → chunk-73G3I5HJ.js} +160 -160
- package/dist/{chunk-7OOFMEX6.js → chunk-BFLYDVEN.js} +28 -41
- package/dist/{chunk-VWGCURZF.js → chunk-BG6PWDJ3.js} +381 -381
- package/dist/{chunk-5VF5LPYS.js → chunk-BV2RNLPP.js} +1 -1
- package/dist/{chunk-NMHQAYZU.js → chunk-CTT4RDXE.js} +150 -151
- package/dist/chunk-E2LJ3FRA.js +237 -0
- package/dist/{chunk-5RH6NYZH.js → chunk-EFQLXRYT.js} +1 -2
- package/dist/{chunk-M6VAZAQW.js → chunk-EVNLJHDD.js} +3 -3
- package/dist/{chunk-NYIIRZSA.js → chunk-GDQQX5SL.js} +4 -42
- package/dist/{chunk-IYATYH5I.js → chunk-GFSOQH3N.js} +1 -1
- package/dist/{chunk-G7O4CBMC.js → chunk-H5AEYSVX.js} +164 -3
- package/dist/{chunk-ZFISGKYW.js → chunk-IIEZXXDD.js} +1 -1
- package/dist/{chunk-5SLRGUC4.js → chunk-INCEZAM3.js} +1 -1
- package/dist/{chunk-ZG6YJUT4.js → chunk-JZQNUQE4.js} +1 -1
- package/dist/{chunk-SB3IHM5Y.js → chunk-K55TU6CC.js} +2023 -1700
- package/dist/chunk-KB5CAN5D.js +33 -0
- package/dist/{chunk-OGHTJKBV.js → chunk-KMA4FOSV.js} +5682 -5675
- package/dist/{chunk-ICHDIVQO.js → chunk-KXNRTJAE.js} +1 -1
- package/dist/{chunk-MLHZUN2X.js → chunk-MGAELVTZ.js} +12 -12
- package/dist/chunk-MKH2KOAO.js +39 -0
- package/dist/{chunk-6BJ5HMMC.js → chunk-NAPXMYFW.js} +35 -362
- package/dist/{chunk-GDTK33QT.js → chunk-OGG3QJYW.js} +14 -5
- package/dist/{chunk-SN7X5N2A.js → chunk-P6HHXMLJ.js} +1 -1
- package/dist/{chunk-SEYOVNS5.js → chunk-QAILYRC2.js} +1 -1
- package/dist/{chunk-RBGVNPA6.js → chunk-RXZ3XDBM.js} +1 -1
- package/dist/{chunk-2ZRY3ARL.js → chunk-SPW6UA6B.js} +1 -1
- package/dist/{chunk-3H5DIJN7.js → chunk-SVZR4GYA.js} +1 -1
- package/dist/{chunk-47YJVIZE.js → chunk-UEY4AB3R.js} +789 -66
- package/dist/{chunk-LFLM723H.js → chunk-UL6MPMKY.js} +1 -1
- package/dist/{chunk-TX3UHDL5.js → chunk-WELN7DDV.js} +2 -2
- package/dist/{chunk-D3XXPCCK.js → chunk-WJN2VVVJ.js} +1 -1
- package/dist/{chunk-DMSTDZCJ.js → chunk-XODQUPFW.js} +11 -11
- package/dist/components/index.d.ts +135 -25
- package/dist/components/index.js +2165 -1996
- package/dist/components/navigation/index.js +7 -8
- package/dist/features/auth/index.d.ts +35 -3716
- package/dist/features/auth/index.js +9 -10
- package/dist/features/clients/index.js +18 -12
- package/dist/features/content/index.js +27 -27
- package/dist/features/crm/index.css +59 -59
- package/dist/features/crm/index.d.ts +17 -1
- package/dist/features/crm/index.js +13 -11
- package/dist/features/dashboard/index.css +59 -59
- package/dist/features/dashboard/index.js +8 -9
- package/dist/features/delivery/index.d.ts +3 -0
- package/dist/features/delivery/index.js +21 -20
- package/dist/features/knowledge/index.js +6 -7
- package/dist/features/lead-gen/index.css +59 -59
- package/dist/features/lead-gen/index.d.ts +3921 -4
- package/dist/features/lead-gen/index.js +15 -13
- package/dist/features/monitoring/index.js +10 -11
- package/dist/features/monitoring/requests/index.css +59 -59
- package/dist/features/monitoring/requests/index.js +8 -9
- package/dist/features/notes/index.js +4 -4
- package/dist/features/operations/index.css +59 -59
- package/dist/features/operations/index.js +13 -15
- package/dist/features/seo/index.css +659 -0
- package/dist/features/seo/index.d.ts +3979 -1
- package/dist/features/seo/index.js +31 -2
- package/dist/features/settings/index.css +59 -59
- package/dist/features/settings/index.d.ts +96 -3742
- package/dist/features/settings/index.js +10 -12
- package/dist/hooks/access/index.js +6 -7
- package/dist/hooks/delivery/index.css +59 -59
- package/dist/hooks/delivery/index.d.ts +12 -4
- package/dist/hooks/delivery/index.js +3 -3
- package/dist/hooks/published.d.ts +83 -29
- package/dist/hooks/published.js +19 -19
- package/dist/initialization/index.d.ts +35 -3716
- package/dist/knowledge/index.js +11 -11
- package/dist/layout/index.d.ts +55 -2
- package/dist/layout/index.js +10 -10
- package/dist/organization/index.css +59 -59
- package/dist/organization/index.d.ts +20 -4
- package/dist/profile/index.d.ts +81 -3716
- package/dist/provider/ElevasisServiceContext.d.ts +1 -2
- package/dist/provider/index.d.ts +4 -2
- package/dist/provider/index.js +6 -7
- package/dist/provider/published.d.ts +4 -2
- package/dist/provider/published.js +6 -7
- package/dist/test-utils/index.d.ts +1 -2
- package/dist/test-utils/index.js +3 -3
- package/dist/theme/index.js +3 -3
- package/dist/theme/presets/index.js +1 -1
- package/dist/types/index.d.ts +298 -251
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +4 -8
- package/src/hooks/README.md +22 -23
- package/dist/chunk-6ZAP3FOA.js +0 -93
- package/dist/chunk-AH52XQB7.js +0 -1
- package/dist/chunk-DVAOCHIF.js +0 -165
- package/dist/chunk-MISHPEJX.js +0 -244
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +0 -879
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +0 -2
- /package/dist/{chunk-A2SB32YV.js → chunk-5ZK7K7YP.js} +0 -0
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { useCredentials, useVerifyCredential } from './chunk-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { eqOrgId, useBatchDeleteRows } from './chunk-KB5CAN5D.js';
|
|
2
|
+
import { LEAD_GEN_API_INTERFACE } from './chunk-WELN7DDV.js';
|
|
3
|
+
import { useCredentials, useVerifyCredential, useListMembers, useListMember, useTransitionListMember, useDeriveActions, useArtifacts } from './chunk-H5AEYSVX.js';
|
|
4
|
+
import { useSupabase } from './chunk-MKH2KOAO.js';
|
|
5
|
+
import { useCompanyFacets, useCompanies, useDeleteCompanies, useContacts, useDeleteContacts } from './chunk-GDQQX5SL.js';
|
|
6
|
+
import { useTableSort, sortData } from './chunk-2Y6AKWGU.js';
|
|
7
|
+
import { getSystemApiInterfaceReadiness } from './chunk-3RK2NNJX.js';
|
|
6
8
|
import { sanitizeInput } from './chunk-3MEXPLWT.js';
|
|
7
9
|
import { useTableSelection } from './chunk-WDBNW44Z.js';
|
|
10
|
+
import { SubshellPageLayout } from './chunk-6B4ZPBQJ.js';
|
|
8
11
|
import { PageContainer } from './chunk-BZZCNLT6.js';
|
|
9
12
|
import { TableSelectionToolbar, SortableHeader } from './chunk-TUMSNGTX.js';
|
|
10
13
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
11
|
-
import {
|
|
12
|
-
import { showApiErrorNotification, showSuccessNotification } from './chunk-
|
|
13
|
-
import { SubshellSidebarSection } from './chunk-MISHPEJX.js';
|
|
14
|
+
import { SubshellSidebarSection, LeadGenSidebarMiddle, PageTitleCaption, acquisitionListKeys, useOptionalElevasisSystems, getAllBuildTemplates, getLeadGenStageCatalog, useListsTelemetry, useLists, useAccess, AccessKeys, SubshellContentContainer, CenteredErrorState, StatCard, usePaginationState, EmptyState, CustomModal, useListActions, useList, useListProgress, useListExecutions, useDeleteList, useExecuteAsync, SystemReadinessAlert, useCreateList, JsonViewer, useWorkflowExecution, useInFlightExecutions, useExecutionSSE, useListRecords } from './chunk-K55TU6CC.js';
|
|
15
|
+
import { showApiErrorNotification, showSuccessNotification } from './chunk-KXNRTJAE.js';
|
|
14
16
|
import { CardHeader } from './chunk-62GVNH5U.js';
|
|
15
|
-
import {
|
|
17
|
+
import { useOrganization } from './chunk-DD3CCMCZ.js';
|
|
18
|
+
import { PAGE_SIZE_DEFAULT, formatTimeAgo, getSystem } from './chunk-5ZK7K7YP.js';
|
|
16
19
|
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
17
|
-
import { Stack, Group, Title, Text, Alert, Button, Collapse, Paper, Anchor, Center, Loader, SimpleGrid, Table, Badge, TextInput, Select, Checkbox, Pagination, ActionIcon, Tooltip, Tabs,
|
|
18
|
-
import { IconTarget, IconAlertCircle, IconPlayerPlay, IconArrowRight, IconListDetails, IconPlus, IconAlertTriangle, IconSearch, IconList, IconExternalLink, IconCopy, IconTrash, IconBuilding, IconUsers, IconBolt, IconLayoutDashboard, IconBuildingFactory2, IconArrowLeft, IconSparkles, IconAddressBook, IconSettings, IconChevronDown,
|
|
20
|
+
import { Stack, Group, Title, Text, Alert, Button, Collapse, Paper, Anchor, Center, Loader, SimpleGrid, Table, Badge, TextInput, Select, Checkbox, Pagination, ActionIcon, Tooltip, Tabs, Switch, Card, Divider, Textarea, ThemeIcon, Box, SegmentedControl, UnstyledButton, Pill, Drawer, JsonInput, NumberInput, MultiSelect, TagsInput, ScrollArea } from '@mantine/core';
|
|
21
|
+
import { IconTarget, IconAlertCircle, IconPlayerPlay, IconArrowRight, IconListDetails, IconPlus, IconAlertTriangle, IconSearch, IconList, IconExternalLink, IconCopy, IconTrash, IconBuilding, IconUsers, IconBolt, IconLayoutDashboard, IconBuildingFactory2, IconMessage, IconArrowLeft, IconCircleDot, IconChevronLeft, IconChevronRight, IconCheck, IconSparkles, IconAddressBook, IconSettings, IconChevronDown, IconRefresh, IconMail, IconUser, IconDatabase } from '@tabler/icons-react';
|
|
19
22
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
20
23
|
import { useState, useRef, useMemo, useCallback, useEffect, Fragment as Fragment$1 } from 'react';
|
|
21
24
|
import { useForm } from '@mantine/form';
|
|
22
25
|
import { zod4Resolver } from 'mantine-form-zod-resolver';
|
|
23
26
|
import { Link, useNavigate, useSearch } from '@tanstack/react-router';
|
|
24
|
-
import { useQueryClient, useMutation } from '@tanstack/react-query';
|
|
27
|
+
import { useQueryClient, useMutation, useQuery } from '@tanstack/react-query';
|
|
28
|
+
import { useClipboard } from '@mantine/hooks';
|
|
29
|
+
import { notifications } from '@mantine/notifications';
|
|
25
30
|
|
|
26
31
|
var LeadGenSidebarTop = () => {
|
|
27
32
|
return /* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconTarget, label: "Lead Gen" });
|
|
@@ -123,15 +128,7 @@ function renderField(field, form, disabled, jsonState, setJsonState) {
|
|
|
123
128
|
value: inputProps.value ?? [],
|
|
124
129
|
onChange: (val) => form.setFieldValue(field.path, val),
|
|
125
130
|
error: inputProps.error,
|
|
126
|
-
children: /* @__PURE__ */ jsx(Stack, { gap: 6, mt: "xs", children: (field.options ?? []).map((option) => /* @__PURE__ */ jsx(
|
|
127
|
-
Checkbox,
|
|
128
|
-
{
|
|
129
|
-
value: option.value,
|
|
130
|
-
label: option.label,
|
|
131
|
-
disabled
|
|
132
|
-
},
|
|
133
|
-
option.value
|
|
134
|
-
)) })
|
|
131
|
+
children: /* @__PURE__ */ jsx(Stack, { gap: 6, mt: "xs", children: (field.options ?? []).map((option) => /* @__PURE__ */ jsx(Checkbox, { value: option.value, label: option.label, disabled }, option.value)) })
|
|
135
132
|
},
|
|
136
133
|
field.path
|
|
137
134
|
);
|
|
@@ -418,7 +415,7 @@ function LeadGenRouteShell({
|
|
|
418
415
|
body,
|
|
419
416
|
links = LEAD_GEN_ROUTE_LINKS
|
|
420
417
|
}) {
|
|
421
|
-
return /* @__PURE__ */ jsx(
|
|
418
|
+
return /* @__PURE__ */ jsx(SubshellPageLayout, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
422
419
|
/* @__PURE__ */ jsx(PageTitleCaption, { title, caption }),
|
|
423
420
|
/* @__PURE__ */ jsx(Paper, { withBorder: true, p: "lg", children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
424
421
|
body,
|
|
@@ -427,7 +424,7 @@ function LeadGenRouteShell({
|
|
|
427
424
|
/* @__PURE__ */ jsx(Anchor, { component: Link, to: link.to, children: link.label })
|
|
428
425
|
] }, link.to)) })
|
|
429
426
|
] }) })
|
|
430
|
-
] }) })
|
|
427
|
+
] }) });
|
|
431
428
|
}
|
|
432
429
|
function formatDate(dateValue) {
|
|
433
430
|
const date = typeof dateValue === "string" ? new Date(dateValue) : dateValue;
|
|
@@ -595,7 +592,9 @@ function CreateListModal({ opened, onClose, canCreate, onCreated }) {
|
|
|
595
592
|
const [newBuildTemplateId, setNewBuildTemplateId] = useState("");
|
|
596
593
|
const [newDataMode, setNewDataMode] = useState("mock");
|
|
597
594
|
const selectedBuildTemplateId = newBuildTemplateId || defaultBuildTemplateId;
|
|
598
|
-
const selectedBuildTemplate = leadGenConfig.buildTemplates?.find(
|
|
595
|
+
const selectedBuildTemplate = leadGenConfig.buildTemplates?.find(
|
|
596
|
+
(template) => template.id === selectedBuildTemplateId
|
|
597
|
+
);
|
|
599
598
|
function resetForm() {
|
|
600
599
|
setNewListName("");
|
|
601
600
|
setNewListDescription("");
|
|
@@ -907,7 +906,7 @@ function LeadGenOverviewPage({ headerActions, tabs, footer } = {}) {
|
|
|
907
906
|
footer ?? null
|
|
908
907
|
] });
|
|
909
908
|
}
|
|
910
|
-
var
|
|
909
|
+
var PAGE_SIZE_DEFAULT2 = 20;
|
|
911
910
|
var STATUS_FILTER_OPTIONS = [
|
|
912
911
|
{ value: "", label: "All statuses" },
|
|
913
912
|
{ value: "draft", label: "Draft" },
|
|
@@ -956,16 +955,16 @@ function LeadGenListsPage() {
|
|
|
956
955
|
return result;
|
|
957
956
|
}, [lists, searchQuery, statusFilter]);
|
|
958
957
|
const sortedLists = useMemo(() => sortData(filteredLists, sort, sortAccessors), [filteredLists, sort, sortAccessors]);
|
|
959
|
-
const pagination = usePaginationState(
|
|
958
|
+
const pagination = usePaginationState(PAGE_SIZE_DEFAULT2, [searchQuery, statusFilter], sortedLists.length);
|
|
960
959
|
const paginatedLists = useMemo(
|
|
961
|
-
() => sortedLists.slice(pagination.offset, pagination.offset +
|
|
960
|
+
() => sortedLists.slice(pagination.offset, pagination.offset + PAGE_SIZE_DEFAULT2),
|
|
962
961
|
[sortedLists, pagination.offset]
|
|
963
962
|
);
|
|
964
963
|
const selection = useTableSelection(paginatedLists, sortedLists);
|
|
965
964
|
const canUseApiActions = leadGenConfig.canUseLeadGenApiActions;
|
|
966
965
|
const apiDisabledReason = leadGenConfig.leadGenApiInterface.reason;
|
|
967
966
|
const canCreateOrDeleteLists = canManageLeadGen.allowed && canUseApiActions;
|
|
968
|
-
return /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ jsxs(SubshellPageLayout, { children: [
|
|
969
968
|
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(
|
|
970
969
|
PageTitleCaption,
|
|
971
970
|
{
|
|
@@ -1062,13 +1061,7 @@ function LeadGenListsPage() {
|
|
|
1062
1061
|
style: { cursor: "pointer" },
|
|
1063
1062
|
onClick: () => navigate({ to: "/lead-gen/lists/$listId", params: { listId: list.id } }),
|
|
1064
1063
|
children: [
|
|
1065
|
-
/* @__PURE__ */ jsx(Table.Td, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(
|
|
1066
|
-
Checkbox,
|
|
1067
|
-
{
|
|
1068
|
-
checked: selection.isSelected(list.id),
|
|
1069
|
-
onChange: () => selection.toggle(list.id)
|
|
1070
|
-
}
|
|
1071
|
-
) }),
|
|
1064
|
+
/* @__PURE__ */ jsx(Table.Td, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(Checkbox, { checked: selection.isSelected(list.id), onChange: () => selection.toggle(list.id) }) }),
|
|
1072
1065
|
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Group, { gap: 6, wrap: "nowrap", children: [
|
|
1073
1066
|
/* @__PURE__ */ jsx(Text, { fw: 500, children: list.name }),
|
|
1074
1067
|
list.instantlyCampaignId ? /* @__PURE__ */ jsx(
|
|
@@ -1106,7 +1099,7 @@ function LeadGenListsPage() {
|
|
|
1106
1099
|
);
|
|
1107
1100
|
}) })
|
|
1108
1101
|
] }),
|
|
1109
|
-
sortedLists.length >
|
|
1102
|
+
sortedLists.length > PAGE_SIZE_DEFAULT2 && /* @__PURE__ */ jsx(Group, { justify: "center", children: /* @__PURE__ */ jsx(
|
|
1110
1103
|
Pagination,
|
|
1111
1104
|
{
|
|
1112
1105
|
value: pagination.page,
|
|
@@ -1150,15 +1143,7 @@ function LeadGenListsPage() {
|
|
|
1150
1143
|
] }),
|
|
1151
1144
|
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "This action cannot be undone." }),
|
|
1152
1145
|
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", mt: "md", children: [
|
|
1153
|
-
/* @__PURE__ */ jsx(
|
|
1154
|
-
Button,
|
|
1155
|
-
{
|
|
1156
|
-
variant: "light",
|
|
1157
|
-
onClick: () => setShowBatchDelete(false),
|
|
1158
|
-
disabled: deleteListsMutation.isPending,
|
|
1159
|
-
children: "Cancel"
|
|
1160
|
-
}
|
|
1161
|
-
),
|
|
1146
|
+
/* @__PURE__ */ jsx(Button, { variant: "light", onClick: () => setShowBatchDelete(false), disabled: deleteListsMutation.isPending, children: "Cancel" }),
|
|
1162
1147
|
/* @__PURE__ */ jsx(
|
|
1163
1148
|
Button,
|
|
1164
1149
|
{
|
|
@@ -1181,7 +1166,7 @@ function LeadGenListsPage() {
|
|
|
1181
1166
|
] })
|
|
1182
1167
|
}
|
|
1183
1168
|
)
|
|
1184
|
-
] })
|
|
1169
|
+
] });
|
|
1185
1170
|
}
|
|
1186
1171
|
|
|
1187
1172
|
// src/lib/lead-gen/legacy-pipeline.ts
|
|
@@ -3333,7 +3318,7 @@ function LeadGenListDetailPage({
|
|
|
3333
3318
|
}
|
|
3334
3319
|
);
|
|
3335
3320
|
if (isLoading) {
|
|
3336
|
-
return /* @__PURE__ */ jsx(
|
|
3321
|
+
return /* @__PURE__ */ jsx(SubshellPageLayout, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
3337
3322
|
/* @__PURE__ */ jsx(
|
|
3338
3323
|
ListDetailHeader,
|
|
3339
3324
|
{
|
|
@@ -3343,7 +3328,7 @@ function LeadGenListDetailPage({
|
|
|
3343
3328
|
}
|
|
3344
3329
|
),
|
|
3345
3330
|
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) })
|
|
3346
|
-
] }) })
|
|
3331
|
+
] }) });
|
|
3347
3332
|
}
|
|
3348
3333
|
if (error) {
|
|
3349
3334
|
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
@@ -3588,8 +3573,14 @@ function ListBuilderIndexPage() {
|
|
|
3588
3573
|
const openList = (listId) => {
|
|
3589
3574
|
navigate({ to: "/lead-gen/lists/$listId", params: { listId }, search: { tab: "build" } });
|
|
3590
3575
|
};
|
|
3591
|
-
return /* @__PURE__ */ jsx(
|
|
3592
|
-
/* @__PURE__ */ jsx(
|
|
3576
|
+
return /* @__PURE__ */ jsx(SubshellPageLayout, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
3577
|
+
/* @__PURE__ */ jsx(
|
|
3578
|
+
PageTitleCaption,
|
|
3579
|
+
{
|
|
3580
|
+
title: "List Builder",
|
|
3581
|
+
caption: "Choose a list to run lead-gen workflows and monitor progress."
|
|
3582
|
+
}
|
|
3583
|
+
),
|
|
3593
3584
|
/* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
3594
3585
|
/* @__PURE__ */ jsx(
|
|
3595
3586
|
TextInput,
|
|
@@ -3641,7 +3632,7 @@ function ListBuilderIndexPage() {
|
|
|
3641
3632
|
)) })
|
|
3642
3633
|
] })
|
|
3643
3634
|
] }) })
|
|
3644
|
-
] }) })
|
|
3635
|
+
] }) });
|
|
3645
3636
|
}
|
|
3646
3637
|
|
|
3647
3638
|
// src/lib/lead-gen/stage-colors.ts
|
|
@@ -4064,10 +4055,10 @@ function ListBuilderPage({ listId }) {
|
|
|
4064
4055
|
}
|
|
4065
4056
|
);
|
|
4066
4057
|
if (isLoading) {
|
|
4067
|
-
return /* @__PURE__ */ jsx(
|
|
4058
|
+
return /* @__PURE__ */ jsx(SubshellPageLayout, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
4068
4059
|
/* @__PURE__ */ jsx(PageTitleCaption, { title: "List Builder", caption: "Lead-gen workspace", rightSection: backButton }),
|
|
4069
4060
|
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) })
|
|
4070
|
-
] }) })
|
|
4061
|
+
] }) });
|
|
4071
4062
|
}
|
|
4072
4063
|
if (error) {
|
|
4073
4064
|
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
@@ -4118,7 +4109,7 @@ function ListBuilderPage({ listId }) {
|
|
|
4118
4109
|
/* @__PURE__ */ jsx(WorkflowRunsPanel, { listId })
|
|
4119
4110
|
] }) }) });
|
|
4120
4111
|
}
|
|
4121
|
-
var
|
|
4112
|
+
var PAGE_SIZE_DEFAULT3 = 20;
|
|
4122
4113
|
function getValueAtPath(source, path) {
|
|
4123
4114
|
return path.split(".").reduce((current, segment) => {
|
|
4124
4115
|
if (current == null || typeof current !== "object") return void 0;
|
|
@@ -4138,7 +4129,7 @@ function LeadGenCompaniesPage({ extraColumns, replaceDefaultColumns } = {}) {
|
|
|
4138
4129
|
const [statusFilter, setStatusFilter] = useState(null);
|
|
4139
4130
|
const [showBatchDelete, setShowBatchDelete] = useState(false);
|
|
4140
4131
|
const navigate = useNavigate();
|
|
4141
|
-
const pagination = usePaginationState(
|
|
4132
|
+
const pagination = usePaginationState(PAGE_SIZE_DEFAULT3, [companySearch, segmentFilter, categoryFilter, statusFilter]);
|
|
4142
4133
|
const { data: companyFacets } = useCompanyFacets();
|
|
4143
4134
|
const {
|
|
4144
4135
|
data: pagedCompanies,
|
|
@@ -4149,7 +4140,7 @@ function LeadGenCompaniesPage({ extraColumns, replaceDefaultColumns } = {}) {
|
|
|
4149
4140
|
segment: segmentFilter || void 0,
|
|
4150
4141
|
category: categoryFilter || void 0,
|
|
4151
4142
|
status: statusFilter || void 0,
|
|
4152
|
-
limit:
|
|
4143
|
+
limit: PAGE_SIZE_DEFAULT3,
|
|
4153
4144
|
offset: pagination.offset
|
|
4154
4145
|
});
|
|
4155
4146
|
const deleteCompaniesMutation = useDeleteCompanies();
|
|
@@ -4168,7 +4159,7 @@ function LeadGenCompaniesPage({ extraColumns, replaceDefaultColumns } = {}) {
|
|
|
4168
4159
|
}
|
|
4169
4160
|
});
|
|
4170
4161
|
}
|
|
4171
|
-
return /* @__PURE__ */
|
|
4162
|
+
return /* @__PURE__ */ jsxs(SubshellPageLayout, { children: [
|
|
4172
4163
|
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title: "Companies", caption: "Company records and enrichment tracking" }) }),
|
|
4173
4164
|
/* @__PURE__ */ jsx(Paper, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
4174
4165
|
/* @__PURE__ */ jsxs(
|
|
@@ -4298,7 +4289,7 @@ function LeadGenCompaniesPage({ extraColumns, replaceDefaultColumns } = {}) {
|
|
|
4298
4289
|
);
|
|
4299
4290
|
}) })
|
|
4300
4291
|
] }),
|
|
4301
|
-
(pagedCompanies?.total ?? 0) >
|
|
4292
|
+
(pagedCompanies?.total ?? 0) > PAGE_SIZE_DEFAULT3 ? /* @__PURE__ */ jsx(Group, { justify: "center", children: /* @__PURE__ */ jsx(
|
|
4302
4293
|
Pagination,
|
|
4303
4294
|
{
|
|
4304
4295
|
value: pagination.page,
|
|
@@ -4323,9 +4314,9 @@ function LeadGenCompaniesPage({ extraColumns, replaceDefaultColumns } = {}) {
|
|
|
4323
4314
|
/* @__PURE__ */ jsx(Button, { color: "red", size: "sm", loading: deleteCompaniesMutation.isPending, onClick: handleBatchDelete, children: "Delete" })
|
|
4324
4315
|
] })
|
|
4325
4316
|
] }) })
|
|
4326
|
-
] })
|
|
4317
|
+
] });
|
|
4327
4318
|
}
|
|
4328
|
-
var
|
|
4319
|
+
var PAGE_SIZE_DEFAULT4 = 20;
|
|
4329
4320
|
function getValueAtPath2(source, path) {
|
|
4330
4321
|
return path.split(".").reduce((current, segment) => {
|
|
4331
4322
|
if (current == null || typeof current !== "object") return void 0;
|
|
@@ -4344,7 +4335,7 @@ function LeadGenContactsPage({ extraColumns, replaceDefaultColumns } = {}) {
|
|
|
4344
4335
|
const [listFilter, setListFilter] = useState(null);
|
|
4345
4336
|
const [showBatchDelete, setShowBatchDelete] = useState(false);
|
|
4346
4337
|
const navigate = useNavigate();
|
|
4347
|
-
const pagination = usePaginationState(
|
|
4338
|
+
const pagination = usePaginationState(PAGE_SIZE_DEFAULT4, [contactSearch, statusFilter, listFilter]);
|
|
4348
4339
|
const { data: lists } = useLists();
|
|
4349
4340
|
const {
|
|
4350
4341
|
data: contacts,
|
|
@@ -4354,7 +4345,7 @@ function LeadGenContactsPage({ extraColumns, replaceDefaultColumns } = {}) {
|
|
|
4354
4345
|
search: contactSearch || void 0,
|
|
4355
4346
|
contactStatus: statusFilter || void 0,
|
|
4356
4347
|
listId: listFilter || void 0,
|
|
4357
|
-
limit:
|
|
4348
|
+
limit: PAGE_SIZE_DEFAULT4,
|
|
4358
4349
|
offset: pagination.offset
|
|
4359
4350
|
});
|
|
4360
4351
|
const deleteContactsMutation = useDeleteContacts();
|
|
@@ -4373,7 +4364,7 @@ function LeadGenContactsPage({ extraColumns, replaceDefaultColumns } = {}) {
|
|
|
4373
4364
|
}
|
|
4374
4365
|
});
|
|
4375
4366
|
}
|
|
4376
|
-
return /* @__PURE__ */
|
|
4367
|
+
return /* @__PURE__ */ jsxs(SubshellPageLayout, { children: [
|
|
4377
4368
|
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title: "Contacts", caption: "Contact records and outreach tracking" }) }),
|
|
4378
4369
|
/* @__PURE__ */ jsx(Paper, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
4379
4370
|
/* @__PURE__ */ jsxs(
|
|
@@ -4490,7 +4481,7 @@ function LeadGenContactsPage({ extraColumns, replaceDefaultColumns } = {}) {
|
|
|
4490
4481
|
);
|
|
4491
4482
|
}) })
|
|
4492
4483
|
] }),
|
|
4493
|
-
(contacts?.total ?? 0) >
|
|
4484
|
+
(contacts?.total ?? 0) > PAGE_SIZE_DEFAULT4 ? /* @__PURE__ */ jsx(Group, { justify: "center", children: /* @__PURE__ */ jsx(
|
|
4494
4485
|
Pagination,
|
|
4495
4486
|
{
|
|
4496
4487
|
value: pagination.page,
|
|
@@ -4515,7 +4506,739 @@ function LeadGenContactsPage({ extraColumns, replaceDefaultColumns } = {}) {
|
|
|
4515
4506
|
/* @__PURE__ */ jsx(Button, { color: "red", size: "sm", loading: deleteContactsMutation.isPending, onClick: handleBatchDelete, children: "Delete" })
|
|
4516
4507
|
] })
|
|
4517
4508
|
] }) })
|
|
4518
|
-
] })
|
|
4509
|
+
] });
|
|
4510
|
+
}
|
|
4511
|
+
var socialPostKeys = {
|
|
4512
|
+
all: ["acq-social-posts"],
|
|
4513
|
+
lists: () => [...socialPostKeys.all, "list"],
|
|
4514
|
+
list: (orgId, filters) => [...socialPostKeys.all, "list", orgId, filters]
|
|
4515
|
+
};
|
|
4516
|
+
function useSocialPosts(filters = {}) {
|
|
4517
|
+
const supabase = useSupabase();
|
|
4518
|
+
const { currentSupabaseOrganizationId } = useOrganization();
|
|
4519
|
+
return useQuery({
|
|
4520
|
+
queryKey: socialPostKeys.list(currentSupabaseOrganizationId, filters),
|
|
4521
|
+
queryFn: async () => {
|
|
4522
|
+
if (!currentSupabaseOrganizationId) return [];
|
|
4523
|
+
let query = eqOrgId(supabase.from("acq_social_posts").select("*"), currentSupabaseOrganizationId);
|
|
4524
|
+
if (filters.platform) {
|
|
4525
|
+
query = query.eq("platform", filters.platform);
|
|
4526
|
+
}
|
|
4527
|
+
if (filters.status) {
|
|
4528
|
+
query = query.eq("status", filters.status);
|
|
4529
|
+
}
|
|
4530
|
+
if (filters.search) {
|
|
4531
|
+
query = query.ilike("post_title", `%${filters.search}%`);
|
|
4532
|
+
}
|
|
4533
|
+
query = query.order("discovered_at", { ascending: false });
|
|
4534
|
+
const { data, error } = await query;
|
|
4535
|
+
if (error) throw error;
|
|
4536
|
+
return data || [];
|
|
4537
|
+
},
|
|
4538
|
+
enabled: !!currentSupabaseOrganizationId
|
|
4539
|
+
});
|
|
4540
|
+
}
|
|
4541
|
+
var socialPostDetailKeys = {
|
|
4542
|
+
detail: (id) => [...socialPostKeys.all, "detail", id]
|
|
4543
|
+
};
|
|
4544
|
+
function useAdjacentPosts(postId) {
|
|
4545
|
+
const { data: posts } = useSocialPosts();
|
|
4546
|
+
if (!posts || posts.length === 0) return { prevId: null, nextId: null };
|
|
4547
|
+
const currentIndex = posts.findIndex((p) => p.id === postId);
|
|
4548
|
+
if (currentIndex === -1) return { prevId: null, nextId: null };
|
|
4549
|
+
let prevId = null;
|
|
4550
|
+
for (let i = currentIndex - 1; i >= 0; i--) {
|
|
4551
|
+
if (!posts[i].reviewed_at) {
|
|
4552
|
+
prevId = posts[i].id;
|
|
4553
|
+
break;
|
|
4554
|
+
}
|
|
4555
|
+
}
|
|
4556
|
+
let nextId = null;
|
|
4557
|
+
for (let i = currentIndex + 1; i < posts.length; i++) {
|
|
4558
|
+
if (!posts[i].reviewed_at) {
|
|
4559
|
+
nextId = posts[i].id;
|
|
4560
|
+
break;
|
|
4561
|
+
}
|
|
4562
|
+
}
|
|
4563
|
+
return { prevId, nextId };
|
|
4564
|
+
}
|
|
4565
|
+
function useSocialPost(postId) {
|
|
4566
|
+
const supabase = useSupabase();
|
|
4567
|
+
const { currentSupabaseOrganizationId } = useOrganization();
|
|
4568
|
+
return useQuery({
|
|
4569
|
+
queryKey: [...socialPostDetailKeys.detail(postId), currentSupabaseOrganizationId],
|
|
4570
|
+
queryFn: async () => {
|
|
4571
|
+
if (!currentSupabaseOrganizationId) return null;
|
|
4572
|
+
const { data, error } = await eqOrgId(
|
|
4573
|
+
supabase.from("acq_social_posts").select("*").eq("id", postId),
|
|
4574
|
+
currentSupabaseOrganizationId
|
|
4575
|
+
).single();
|
|
4576
|
+
if (error) throw error;
|
|
4577
|
+
return data;
|
|
4578
|
+
},
|
|
4579
|
+
enabled: !!currentSupabaseOrganizationId && !!postId
|
|
4580
|
+
});
|
|
4581
|
+
}
|
|
4582
|
+
function useDeleteSocialPost() {
|
|
4583
|
+
const supabase = useSupabase();
|
|
4584
|
+
const queryClient = useQueryClient();
|
|
4585
|
+
return useMutation({
|
|
4586
|
+
mutationFn: async (postId) => {
|
|
4587
|
+
const { error } = await supabase.from("acq_social_posts").delete().eq("id", postId);
|
|
4588
|
+
if (error) throw error;
|
|
4589
|
+
},
|
|
4590
|
+
onError: (err) => {
|
|
4591
|
+
showApiErrorNotification(err);
|
|
4592
|
+
},
|
|
4593
|
+
onSettled: () => {
|
|
4594
|
+
queryClient.invalidateQueries({ queryKey: socialPostKeys.all });
|
|
4595
|
+
}
|
|
4596
|
+
});
|
|
4597
|
+
}
|
|
4598
|
+
function useUpdateSocialPost(postId) {
|
|
4599
|
+
const supabase = useSupabase();
|
|
4600
|
+
const queryClient = useQueryClient();
|
|
4601
|
+
return useMutation({
|
|
4602
|
+
mutationFn: async (fields) => {
|
|
4603
|
+
const { error } = await supabase.from("acq_social_posts").update({ ...fields, updated_at: (/* @__PURE__ */ new Date()).toISOString() }).eq("id", postId);
|
|
4604
|
+
if (error) throw error;
|
|
4605
|
+
},
|
|
4606
|
+
onMutate: async (fields) => {
|
|
4607
|
+
const queryKey = socialPostDetailKeys.detail(postId);
|
|
4608
|
+
await queryClient.cancelQueries({ queryKey });
|
|
4609
|
+
const previous = queryClient.getQueriesData({ queryKey });
|
|
4610
|
+
queryClient.setQueriesData({ queryKey }, (old) => {
|
|
4611
|
+
if (!old) return old;
|
|
4612
|
+
return { ...old, ...fields, updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
4613
|
+
});
|
|
4614
|
+
return { previous };
|
|
4615
|
+
},
|
|
4616
|
+
onError: (_err, _fields, context) => {
|
|
4617
|
+
if (context?.previous) {
|
|
4618
|
+
for (const [queryKey, data] of context.previous) {
|
|
4619
|
+
queryClient.setQueryData(queryKey, data);
|
|
4620
|
+
}
|
|
4621
|
+
}
|
|
4622
|
+
showApiErrorNotification(_err);
|
|
4623
|
+
},
|
|
4624
|
+
onSettled: () => {
|
|
4625
|
+
queryClient.invalidateQueries({ queryKey: socialPostDetailKeys.detail(postId) });
|
|
4626
|
+
queryClient.invalidateQueries({ queryKey: socialPostKeys.all });
|
|
4627
|
+
}
|
|
4628
|
+
});
|
|
4629
|
+
}
|
|
4630
|
+
var platformOptions = [
|
|
4631
|
+
{ value: "reddit", label: "Reddit" },
|
|
4632
|
+
{ value: "linkedin", label: "LinkedIn" }
|
|
4633
|
+
];
|
|
4634
|
+
var statusOptions = [
|
|
4635
|
+
{ value: "new", label: "New" },
|
|
4636
|
+
{ value: "skipped", label: "Skipped" },
|
|
4637
|
+
{ value: "complete", label: "Complete" }
|
|
4638
|
+
];
|
|
4639
|
+
var platformColors = {
|
|
4640
|
+
reddit: "orange",
|
|
4641
|
+
linkedin: "blue"
|
|
4642
|
+
};
|
|
4643
|
+
var statusColors = {
|
|
4644
|
+
new: "blue",
|
|
4645
|
+
skipped: "gray",
|
|
4646
|
+
complete: "green"
|
|
4647
|
+
};
|
|
4648
|
+
function SocialMonitoringPage({ onPostClick }) {
|
|
4649
|
+
const [platformFilter, setPlatformFilter] = useState(null);
|
|
4650
|
+
const [statusFilter, setStatusFilter] = useState(null);
|
|
4651
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
4652
|
+
const [hideReviewed, setHideReviewed] = useState(true);
|
|
4653
|
+
const [deleteTarget, setDeleteTarget] = useState(null);
|
|
4654
|
+
const deleteMutation = useDeleteSocialPost();
|
|
4655
|
+
const { data: posts, isLoading } = useSocialPosts({
|
|
4656
|
+
platform: platformFilter || void 0,
|
|
4657
|
+
status: statusFilter || void 0,
|
|
4658
|
+
search: searchQuery || void 0
|
|
4659
|
+
});
|
|
4660
|
+
const filteredPosts = useMemo(() => {
|
|
4661
|
+
if (!posts) return [];
|
|
4662
|
+
if (!hideReviewed) return posts;
|
|
4663
|
+
return posts.filter((p) => !p.reviewed_at);
|
|
4664
|
+
}, [posts, hideReviewed]);
|
|
4665
|
+
const { sort, toggleSort } = useTableSort("discovered_at");
|
|
4666
|
+
const sortAccessors = useMemo(
|
|
4667
|
+
() => ({
|
|
4668
|
+
platform: (p) => p.platform,
|
|
4669
|
+
source: (p) => p.source_category,
|
|
4670
|
+
author: (p) => p.author_name,
|
|
4671
|
+
post: (p) => p.post_title,
|
|
4672
|
+
score: (p) => p.relevance_score,
|
|
4673
|
+
status: (p) => p.status,
|
|
4674
|
+
discovered_at: (p) => p.discovered_at
|
|
4675
|
+
}),
|
|
4676
|
+
[]
|
|
4677
|
+
);
|
|
4678
|
+
const sortedPosts = useMemo(() => sortData(filteredPosts, sort, sortAccessors), [filteredPosts, sort, sortAccessors]);
|
|
4679
|
+
const pagination = usePaginationState(
|
|
4680
|
+
PAGE_SIZE_DEFAULT,
|
|
4681
|
+
[platformFilter, statusFilter, searchQuery, hideReviewed],
|
|
4682
|
+
sortedPosts.length
|
|
4683
|
+
);
|
|
4684
|
+
const paginatedPosts = useMemo(() => {
|
|
4685
|
+
return sortedPosts.slice(pagination.offset, pagination.offset + PAGE_SIZE_DEFAULT);
|
|
4686
|
+
}, [sortedPosts, pagination.offset]);
|
|
4687
|
+
const selection = useTableSelection(paginatedPosts, filteredPosts);
|
|
4688
|
+
const batchDeleteMutation = useBatchDeleteRows("acq_social_posts", [["acq-social-posts"]]);
|
|
4689
|
+
const [showBatchDelete, setShowBatchDelete] = useState(false);
|
|
4690
|
+
return /* @__PURE__ */ jsxs(SubshellPageLayout, { children: [
|
|
4691
|
+
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title: "Social Monitoring", caption: "Track social media posts from Reddit and LinkedIn" }) }),
|
|
4692
|
+
/* @__PURE__ */ jsx(Paper, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
4693
|
+
/* @__PURE__ */ jsxs(
|
|
4694
|
+
FilterBar,
|
|
4695
|
+
{
|
|
4696
|
+
actions: /* @__PURE__ */ jsxs(Group, { gap: "md", children: [
|
|
4697
|
+
/* @__PURE__ */ jsx(
|
|
4698
|
+
Switch,
|
|
4699
|
+
{
|
|
4700
|
+
label: "Hide reviewed",
|
|
4701
|
+
size: "sm",
|
|
4702
|
+
checked: hideReviewed,
|
|
4703
|
+
onChange: (e) => setHideReviewed(e.currentTarget.checked)
|
|
4704
|
+
}
|
|
4705
|
+
),
|
|
4706
|
+
/* @__PURE__ */ jsx(
|
|
4707
|
+
TableSelectionToolbar,
|
|
4708
|
+
{
|
|
4709
|
+
selectedCount: selection.selectedCount,
|
|
4710
|
+
onDelete: () => setShowBatchDelete(true),
|
|
4711
|
+
isDeleting: batchDeleteMutation.isPending
|
|
4712
|
+
}
|
|
4713
|
+
)
|
|
4714
|
+
] }),
|
|
4715
|
+
children: [
|
|
4716
|
+
/* @__PURE__ */ jsx(
|
|
4717
|
+
Select,
|
|
4718
|
+
{
|
|
4719
|
+
placeholder: "All Platforms",
|
|
4720
|
+
data: platformOptions,
|
|
4721
|
+
style: { minWidth: 160 },
|
|
4722
|
+
size: "sm",
|
|
4723
|
+
clearable: true,
|
|
4724
|
+
value: platformFilter,
|
|
4725
|
+
onChange: setPlatformFilter
|
|
4726
|
+
}
|
|
4727
|
+
),
|
|
4728
|
+
/* @__PURE__ */ jsx(
|
|
4729
|
+
Select,
|
|
4730
|
+
{
|
|
4731
|
+
placeholder: "All Statuses",
|
|
4732
|
+
data: statusOptions,
|
|
4733
|
+
style: { minWidth: 160 },
|
|
4734
|
+
size: "sm",
|
|
4735
|
+
clearable: true,
|
|
4736
|
+
value: statusFilter,
|
|
4737
|
+
onChange: setStatusFilter
|
|
4738
|
+
}
|
|
4739
|
+
),
|
|
4740
|
+
/* @__PURE__ */ jsx(
|
|
4741
|
+
TextInput,
|
|
4742
|
+
{
|
|
4743
|
+
placeholder: "Search post text...",
|
|
4744
|
+
leftSection: /* @__PURE__ */ jsx(IconSearch, { size: 16 }),
|
|
4745
|
+
style: { minWidth: 250 },
|
|
4746
|
+
size: "sm",
|
|
4747
|
+
value: searchQuery,
|
|
4748
|
+
onChange: (e) => setSearchQuery(e.target.value)
|
|
4749
|
+
}
|
|
4750
|
+
)
|
|
4751
|
+
]
|
|
4752
|
+
}
|
|
4753
|
+
),
|
|
4754
|
+
isLoading ? /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) : !filteredPosts.length ? /* @__PURE__ */ jsx(EmptyState, { icon: IconMessage, title: "No social posts found" }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Table, { children: [
|
|
4755
|
+
/* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
4756
|
+
/* @__PURE__ */ jsx(Table.Th, { w: 40, children: /* @__PURE__ */ jsx(
|
|
4757
|
+
Checkbox,
|
|
4758
|
+
{
|
|
4759
|
+
checked: selection.isPageAllSelected,
|
|
4760
|
+
indeterminate: selection.isPagePartiallySelected,
|
|
4761
|
+
onChange: selection.togglePage,
|
|
4762
|
+
size: "sm"
|
|
4763
|
+
}
|
|
4764
|
+
) }),
|
|
4765
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "platform", sort, onToggle: toggleSort, children: "Platform" }),
|
|
4766
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "source", sort, onToggle: toggleSort, children: "Source" }),
|
|
4767
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "author", sort, onToggle: toggleSort, children: "Author" }),
|
|
4768
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "post", sort, onToggle: toggleSort, children: "Post" }),
|
|
4769
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "score", sort, onToggle: toggleSort, children: "Score" }),
|
|
4770
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "status", sort, onToggle: toggleSort, children: "Status" }),
|
|
4771
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "discovered_at", sort, onToggle: toggleSort, children: "Discovered" }),
|
|
4772
|
+
/* @__PURE__ */ jsx(Table.Th, { w: 50 })
|
|
4773
|
+
] }) }),
|
|
4774
|
+
/* @__PURE__ */ jsx(Table.Tbody, { children: paginatedPosts.map((post) => /* @__PURE__ */ jsxs(Table.Tr, { style: { cursor: "pointer" }, onClick: () => onPostClick(post.id), children: [
|
|
4775
|
+
/* @__PURE__ */ jsx(Table.Td, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(
|
|
4776
|
+
Checkbox,
|
|
4777
|
+
{
|
|
4778
|
+
checked: selection.isSelected(post.id),
|
|
4779
|
+
onChange: () => selection.toggle(post.id),
|
|
4780
|
+
size: "sm"
|
|
4781
|
+
}
|
|
4782
|
+
) }),
|
|
4783
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { variant: "light", color: platformColors[post.platform] || "gray", size: "sm", children: post.platform }) }),
|
|
4784
|
+
/* @__PURE__ */ jsx(Table.Td, { children: post.source_category ? /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: post.platform === "reddit" ? `r/${post.source_category}` : post.source_category }) : /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "-" }) }),
|
|
4785
|
+
/* @__PURE__ */ jsx(Table.Td, { children: post.author_url ? /* @__PURE__ */ jsx(Anchor, { href: post.author_url, target: "_blank", size: "sm", children: post.author_name }) : /* @__PURE__ */ jsx(Text, { size: "sm", children: post.author_name }) }),
|
|
4786
|
+
/* @__PURE__ */ jsx(Table.Td, { style: { maxWidth: 400 }, children: /* @__PURE__ */ jsx(Text, { size: "sm", lineClamp: 1, title: post.post_title, children: post.post_title }) }),
|
|
4787
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, children: post.relevance_score }) }),
|
|
4788
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { variant: "light", color: statusColors[post.status] || "gray", size: "sm", children: post.status }) }),
|
|
4789
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: formatTimeAgo(post.discovered_at) }) }),
|
|
4790
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(
|
|
4791
|
+
ActionIcon,
|
|
4792
|
+
{
|
|
4793
|
+
variant: "subtle",
|
|
4794
|
+
color: "red",
|
|
4795
|
+
size: "sm",
|
|
4796
|
+
onClick: (e) => {
|
|
4797
|
+
e.stopPropagation();
|
|
4798
|
+
setDeleteTarget(post);
|
|
4799
|
+
},
|
|
4800
|
+
children: /* @__PURE__ */ jsx(IconTrash, { size: 14 })
|
|
4801
|
+
}
|
|
4802
|
+
) })
|
|
4803
|
+
] }, post.id)) })
|
|
4804
|
+
] }) }),
|
|
4805
|
+
sortedPosts.length > PAGE_SIZE_DEFAULT && /* @__PURE__ */ jsx(Group, { justify: "center", children: /* @__PURE__ */ jsx(
|
|
4806
|
+
Pagination,
|
|
4807
|
+
{
|
|
4808
|
+
value: pagination.page,
|
|
4809
|
+
onChange: pagination.setPage,
|
|
4810
|
+
total: pagination.totalPages(sortedPosts.length),
|
|
4811
|
+
size: "sm"
|
|
4812
|
+
}
|
|
4813
|
+
) })
|
|
4814
|
+
] }) }),
|
|
4815
|
+
/* @__PURE__ */ jsx(
|
|
4816
|
+
CustomModal,
|
|
4817
|
+
{
|
|
4818
|
+
opened: !!deleteTarget,
|
|
4819
|
+
onClose: () => !deleteMutation.isPending && setDeleteTarget(null),
|
|
4820
|
+
size: "sm",
|
|
4821
|
+
loading: deleteMutation.isPending,
|
|
4822
|
+
children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
4823
|
+
/* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
|
|
4824
|
+
/* @__PURE__ */ jsx(IconAlertTriangle, { size: 24, color: "var(--color-error)" }),
|
|
4825
|
+
/* @__PURE__ */ jsx(Title, { order: 4, children: "Delete Post" })
|
|
4826
|
+
] }),
|
|
4827
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
4828
|
+
"Are you sure you want to delete this post by",
|
|
4829
|
+
" ",
|
|
4830
|
+
/* @__PURE__ */ jsx(Text, { span: true, fw: 600, children: deleteTarget?.author_name }),
|
|
4831
|
+
"?"
|
|
4832
|
+
] }),
|
|
4833
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "This action cannot be undone." }),
|
|
4834
|
+
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", mt: "md", children: [
|
|
4835
|
+
/* @__PURE__ */ jsx(Button, { variant: "light", onClick: () => setDeleteTarget(null), disabled: deleteMutation.isPending, children: "Cancel" }),
|
|
4836
|
+
/* @__PURE__ */ jsx(
|
|
4837
|
+
Button,
|
|
4838
|
+
{
|
|
4839
|
+
color: "red",
|
|
4840
|
+
loading: deleteMutation.isPending,
|
|
4841
|
+
onClick: () => {
|
|
4842
|
+
if (!deleteTarget) return;
|
|
4843
|
+
deleteMutation.mutate(deleteTarget.id, {
|
|
4844
|
+
onSuccess: () => setDeleteTarget(null)
|
|
4845
|
+
});
|
|
4846
|
+
},
|
|
4847
|
+
children: "Delete"
|
|
4848
|
+
}
|
|
4849
|
+
)
|
|
4850
|
+
] })
|
|
4851
|
+
] })
|
|
4852
|
+
}
|
|
4853
|
+
),
|
|
4854
|
+
/* @__PURE__ */ jsx(
|
|
4855
|
+
CustomModal,
|
|
4856
|
+
{
|
|
4857
|
+
opened: showBatchDelete,
|
|
4858
|
+
onClose: () => !batchDeleteMutation.isPending && setShowBatchDelete(false),
|
|
4859
|
+
size: "sm",
|
|
4860
|
+
loading: batchDeleteMutation.isPending,
|
|
4861
|
+
children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
4862
|
+
/* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
|
|
4863
|
+
/* @__PURE__ */ jsx(IconAlertTriangle, { size: 24, color: "var(--color-error)" }),
|
|
4864
|
+
/* @__PURE__ */ jsxs(Title, { order: 4, children: [
|
|
4865
|
+
"Delete ",
|
|
4866
|
+
selection.selectedCount,
|
|
4867
|
+
" Posts"
|
|
4868
|
+
] })
|
|
4869
|
+
] }),
|
|
4870
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
4871
|
+
"Are you sure you want to delete",
|
|
4872
|
+
" ",
|
|
4873
|
+
/* @__PURE__ */ jsx(Text, { span: true, fw: 600, children: selection.selectedCount }),
|
|
4874
|
+
" ",
|
|
4875
|
+
"selected posts?"
|
|
4876
|
+
] }),
|
|
4877
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "This action cannot be undone." }),
|
|
4878
|
+
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", mt: "md", children: [
|
|
4879
|
+
/* @__PURE__ */ jsx(Button, { variant: "light", onClick: () => setShowBatchDelete(false), disabled: batchDeleteMutation.isPending, children: "Cancel" }),
|
|
4880
|
+
/* @__PURE__ */ jsx(
|
|
4881
|
+
Button,
|
|
4882
|
+
{
|
|
4883
|
+
color: "red",
|
|
4884
|
+
loading: batchDeleteMutation.isPending,
|
|
4885
|
+
onClick: () => {
|
|
4886
|
+
batchDeleteMutation.mutate([...selection.selectedIds], {
|
|
4887
|
+
onSuccess: () => {
|
|
4888
|
+
setShowBatchDelete(false);
|
|
4889
|
+
selection.clear();
|
|
4890
|
+
}
|
|
4891
|
+
});
|
|
4892
|
+
},
|
|
4893
|
+
children: "Delete"
|
|
4894
|
+
}
|
|
4895
|
+
)
|
|
4896
|
+
] })
|
|
4897
|
+
] })
|
|
4898
|
+
}
|
|
4899
|
+
)
|
|
4900
|
+
] });
|
|
4901
|
+
}
|
|
4902
|
+
var platformColors2 = {
|
|
4903
|
+
reddit: "orange",
|
|
4904
|
+
linkedin: "blue"
|
|
4905
|
+
};
|
|
4906
|
+
var statusColors2 = {
|
|
4907
|
+
new: "blue",
|
|
4908
|
+
skipped: "gray",
|
|
4909
|
+
complete: "green"
|
|
4910
|
+
};
|
|
4911
|
+
var statusOptions2 = [
|
|
4912
|
+
{ value: "new", label: "New" },
|
|
4913
|
+
{ value: "skipped", label: "Skipped" },
|
|
4914
|
+
{ value: "complete", label: "Complete" }
|
|
4915
|
+
];
|
|
4916
|
+
function formatDate2(dateString) {
|
|
4917
|
+
if (!dateString) return "-";
|
|
4918
|
+
return new Date(dateString).toLocaleString();
|
|
4919
|
+
}
|
|
4920
|
+
function SocialPostDetailPage({
|
|
4921
|
+
postId,
|
|
4922
|
+
onPostChange,
|
|
4923
|
+
onBack,
|
|
4924
|
+
backLabel = "Social Monitoring"
|
|
4925
|
+
}) {
|
|
4926
|
+
const { data: post, isLoading } = useSocialPost(postId);
|
|
4927
|
+
const updatePost = useUpdateSocialPost(postId);
|
|
4928
|
+
const { prevId, nextId } = useAdjacentPosts(postId);
|
|
4929
|
+
const idClipboard = useClipboard({ timeout: 2e3 });
|
|
4930
|
+
const [finalResponse, setFinalResponse] = useState("");
|
|
4931
|
+
const [skipReason, setSkipReason] = useState("");
|
|
4932
|
+
const [feedback, setFeedback] = useState("");
|
|
4933
|
+
const [showSaved, setShowSaved] = useState(false);
|
|
4934
|
+
useEffect(() => {
|
|
4935
|
+
if (post?.final_response !== void 0) {
|
|
4936
|
+
setFinalResponse(post.final_response ?? "");
|
|
4937
|
+
}
|
|
4938
|
+
}, [post?.final_response]);
|
|
4939
|
+
useEffect(() => {
|
|
4940
|
+
if (post?.skip_reason !== void 0) {
|
|
4941
|
+
setSkipReason(post.skip_reason ?? "");
|
|
4942
|
+
}
|
|
4943
|
+
}, [post?.skip_reason]);
|
|
4944
|
+
useEffect(() => {
|
|
4945
|
+
if (post?.feedback !== void 0) {
|
|
4946
|
+
setFeedback(post.feedback ?? "");
|
|
4947
|
+
}
|
|
4948
|
+
}, [post?.feedback]);
|
|
4949
|
+
useEffect(() => {
|
|
4950
|
+
if (!updatePost.isSuccess) return;
|
|
4951
|
+
setShowSaved(true);
|
|
4952
|
+
const timer = setTimeout(() => setShowSaved(false), 2e3);
|
|
4953
|
+
return () => clearTimeout(timer);
|
|
4954
|
+
}, [updatePost.isSuccess]);
|
|
4955
|
+
if (isLoading) {
|
|
4956
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) });
|
|
4957
|
+
}
|
|
4958
|
+
if (!post) {
|
|
4959
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Alert, { color: "yellow", children: "Post not found" }) }) });
|
|
4960
|
+
}
|
|
4961
|
+
const metadata = post.metadata ?? {};
|
|
4962
|
+
const navigateToPost = (id) => {
|
|
4963
|
+
onPostChange(id);
|
|
4964
|
+
};
|
|
4965
|
+
return /* @__PURE__ */ jsxs(SubshellPageLayout, { children: [
|
|
4966
|
+
/* @__PURE__ */ jsxs(Stack, { children: [
|
|
4967
|
+
/* @__PURE__ */ jsx(
|
|
4968
|
+
PageTitleCaption,
|
|
4969
|
+
{
|
|
4970
|
+
title: post.author_name,
|
|
4971
|
+
caption: `${post.platform} post \xB7 Score ${post.relevance_score}`,
|
|
4972
|
+
rightSection: /* @__PURE__ */ jsx(Button, { variant: "light", size: "sm", leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }), onClick: onBack, children: backLabel })
|
|
4973
|
+
}
|
|
4974
|
+
),
|
|
4975
|
+
/* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
4976
|
+
/* @__PURE__ */ jsx(Badge, { color: platformColors2[post.platform] ?? "gray", size: "sm", children: post.platform }),
|
|
4977
|
+
/* @__PURE__ */ jsx(Badge, { color: statusColors2[post.status] ?? "gray", size: "sm", children: post.status }),
|
|
4978
|
+
/* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
|
|
4979
|
+
"Discovered ",
|
|
4980
|
+
formatTimeAgo(post.discovered_at)
|
|
4981
|
+
] })
|
|
4982
|
+
] })
|
|
4983
|
+
] }),
|
|
4984
|
+
/* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
4985
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: "Post Content" }),
|
|
4986
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
4987
|
+
/* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
4988
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", fw: 600, c: "dimmed", tt: "uppercase", children: "Title" }),
|
|
4989
|
+
/* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsx(Text, { size: "sm", children: post.post_title }) })
|
|
4990
|
+
] }),
|
|
4991
|
+
/* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
4992
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", fw: 600, c: "dimmed", tt: "uppercase", children: "Body" }),
|
|
4993
|
+
/* @__PURE__ */ jsx(Card, { withBorder: true, children: post.post_text ? /* @__PURE__ */ jsx(Text, { size: "sm", style: { whiteSpace: "pre-wrap" }, children: post.post_text }) : /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", fs: "italic", children: "No body text" }) })
|
|
4994
|
+
] }),
|
|
4995
|
+
/* @__PURE__ */ jsx(Group, { children: /* @__PURE__ */ jsx(Anchor, { href: post.post_url, target: "_blank", size: "sm", children: /* @__PURE__ */ jsxs(Group, { gap: 4, children: [
|
|
4996
|
+
"Open on ",
|
|
4997
|
+
post.platform === "reddit" ? "Reddit" : "LinkedIn",
|
|
4998
|
+
/* @__PURE__ */ jsx(IconExternalLink, { size: 14 })
|
|
4999
|
+
] }) }) })
|
|
5000
|
+
] }) }),
|
|
5001
|
+
/* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
5002
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: "Details" }),
|
|
5003
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
5004
|
+
/* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 1, sm: 2 }, spacing: "sm", verticalSpacing: "sm", children: [
|
|
5005
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
5006
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "Author" }),
|
|
5007
|
+
post.author_url ? /* @__PURE__ */ jsx(Anchor, { href: post.author_url, target: "_blank", size: "sm", children: post.author_name }) : /* @__PURE__ */ jsx(Text, { size: "sm", children: post.author_name })
|
|
5008
|
+
] }),
|
|
5009
|
+
post.platform === "linkedin" && !!metadata.authorHeadline && /* @__PURE__ */ jsxs(Group, { children: [
|
|
5010
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "Headline" }),
|
|
5011
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: String(metadata.authorHeadline) })
|
|
5012
|
+
] }),
|
|
5013
|
+
post.platform === "linkedin" && !!metadata.authorCompany && /* @__PURE__ */ jsxs(Group, { children: [
|
|
5014
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "Company" }),
|
|
5015
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: String(metadata.authorCompany) })
|
|
5016
|
+
] }),
|
|
5017
|
+
post.platform === "linkedin" && !!metadata.authorTier && /* @__PURE__ */ jsxs(Group, { children: [
|
|
5018
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "Author Tier" }),
|
|
5019
|
+
/* @__PURE__ */ jsxs(Badge, { size: "sm", variant: "outline", children: [
|
|
5020
|
+
"Tier ",
|
|
5021
|
+
String(metadata.authorTier)
|
|
5022
|
+
] })
|
|
5023
|
+
] }),
|
|
5024
|
+
post.source_category && /* @__PURE__ */ jsxs(Group, { children: [
|
|
5025
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: post.platform === "reddit" ? "Subreddit" : "Source" }),
|
|
5026
|
+
post.platform === "reddit" ? /* @__PURE__ */ jsxs(Anchor, { href: `https://www.reddit.com/r/${post.source_category}`, target: "_blank", size: "sm", children: [
|
|
5027
|
+
"r/",
|
|
5028
|
+
post.source_category
|
|
5029
|
+
] }) : /* @__PURE__ */ jsx(Text, { size: "sm", children: post.source_category })
|
|
5030
|
+
] }),
|
|
5031
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
5032
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "Relevance Score" }),
|
|
5033
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, children: post.relevance_score })
|
|
5034
|
+
] }),
|
|
5035
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
5036
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "Engagement" }),
|
|
5037
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
5038
|
+
post.engagement_count,
|
|
5039
|
+
" ",
|
|
5040
|
+
post.platform === "reddit" ? "upvotes" : "likes"
|
|
5041
|
+
] })
|
|
5042
|
+
] }),
|
|
5043
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
5044
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "Comments" }),
|
|
5045
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: post.comments_count })
|
|
5046
|
+
] }),
|
|
5047
|
+
post.platform === "linkedin" && metadata.sharesCount != null && /* @__PURE__ */ jsxs(Group, { children: [
|
|
5048
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "Shares" }),
|
|
5049
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: String(metadata.sharesCount) })
|
|
5050
|
+
] }),
|
|
5051
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
5052
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "Posted" }),
|
|
5053
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: formatDate2(post.posted_at) })
|
|
5054
|
+
] }),
|
|
5055
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
5056
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "Discovered" }),
|
|
5057
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: formatDate2(post.discovered_at) })
|
|
5058
|
+
] }),
|
|
5059
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
5060
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "ID" }),
|
|
5061
|
+
/* @__PURE__ */ jsxs(Group, { gap: 4, children: [
|
|
5062
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", ff: "monospace", children: post.id }),
|
|
5063
|
+
/* @__PURE__ */ jsx(Tooltip, { label: idClipboard.copied ? "Copied!" : "Copy ID", children: /* @__PURE__ */ jsx(
|
|
5064
|
+
ActionIcon,
|
|
5065
|
+
{
|
|
5066
|
+
size: "sm",
|
|
5067
|
+
variant: "subtle",
|
|
5068
|
+
color: idClipboard.copied ? "teal" : "gray",
|
|
5069
|
+
onClick: () => {
|
|
5070
|
+
idClipboard.copy(post.id);
|
|
5071
|
+
notifications.show({ message: "ID copied to clipboard", color: "teal" });
|
|
5072
|
+
},
|
|
5073
|
+
children: /* @__PURE__ */ jsx(IconCopy, { size: 14 })
|
|
5074
|
+
}
|
|
5075
|
+
) })
|
|
5076
|
+
] })
|
|
5077
|
+
] }),
|
|
5078
|
+
post.matched_keywords && post.matched_keywords.length > 0 && /* @__PURE__ */ jsxs(Group, { children: [
|
|
5079
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "Keywords" }),
|
|
5080
|
+
/* @__PURE__ */ jsx(Group, { gap: 4, children: post.matched_keywords.map((kw) => /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "outline", children: kw }, kw)) })
|
|
5081
|
+
] })
|
|
5082
|
+
] })
|
|
5083
|
+
] }) }),
|
|
5084
|
+
/* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
5085
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: "Status & Response" }),
|
|
5086
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
5087
|
+
/* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 1, sm: 2 }, spacing: "sm", verticalSpacing: "sm", children: [
|
|
5088
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
5089
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "Status" }),
|
|
5090
|
+
/* @__PURE__ */ jsx(
|
|
5091
|
+
Select,
|
|
5092
|
+
{
|
|
5093
|
+
value: post.status,
|
|
5094
|
+
onChange: (value) => {
|
|
5095
|
+
if (!value) return;
|
|
5096
|
+
const fields = {
|
|
5097
|
+
status: value
|
|
5098
|
+
};
|
|
5099
|
+
if (value === "complete" && !post.responded_at) {
|
|
5100
|
+
fields.responded_at = (/* @__PURE__ */ new Date()).toISOString();
|
|
5101
|
+
}
|
|
5102
|
+
if (value !== "new" && !post.reviewed_at) {
|
|
5103
|
+
fields.reviewed_at = (/* @__PURE__ */ new Date()).toISOString();
|
|
5104
|
+
}
|
|
5105
|
+
if (value === "new") {
|
|
5106
|
+
fields.reviewed_at = null;
|
|
5107
|
+
}
|
|
5108
|
+
updatePost.mutate(fields);
|
|
5109
|
+
},
|
|
5110
|
+
data: statusOptions2,
|
|
5111
|
+
leftSection: /* @__PURE__ */ jsx(IconCircleDot, { size: 16, color: "var(--color-text-subtle)" }),
|
|
5112
|
+
size: "xs",
|
|
5113
|
+
w: 160,
|
|
5114
|
+
variant: "unstyled",
|
|
5115
|
+
withCheckIcon: true,
|
|
5116
|
+
styles: {
|
|
5117
|
+
wrapper: {
|
|
5118
|
+
border: "1px solid var(--color-border)",
|
|
5119
|
+
borderRadius: "var(--mantine-radius-default)",
|
|
5120
|
+
backgroundColor: "var(--color-surface)"
|
|
5121
|
+
},
|
|
5122
|
+
input: {
|
|
5123
|
+
fontSize: "var(--mantine-font-size-xs)",
|
|
5124
|
+
fontWeight: 500,
|
|
5125
|
+
height: "30px",
|
|
5126
|
+
minHeight: "30px",
|
|
5127
|
+
paddingLeft: "30px",
|
|
5128
|
+
cursor: "pointer"
|
|
5129
|
+
},
|
|
5130
|
+
section: {
|
|
5131
|
+
color: "var(--color-text-subtle)"
|
|
5132
|
+
},
|
|
5133
|
+
dropdown: {
|
|
5134
|
+
border: "1px solid var(--color-border)",
|
|
5135
|
+
backgroundColor: "var(--color-surface)",
|
|
5136
|
+
boxShadow: "var(--card-shadow)"
|
|
5137
|
+
},
|
|
5138
|
+
option: { fontSize: "var(--mantine-font-size-xs)" }
|
|
5139
|
+
}
|
|
5140
|
+
}
|
|
5141
|
+
)
|
|
5142
|
+
] }),
|
|
5143
|
+
post.responded_at && /* @__PURE__ */ jsxs(Group, { children: [
|
|
5144
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", w: 130, children: "Responded At" }),
|
|
5145
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: formatDate2(post.responded_at) })
|
|
5146
|
+
] })
|
|
5147
|
+
] }),
|
|
5148
|
+
post.initial_draft && /* @__PURE__ */ jsxs("div", { children: [
|
|
5149
|
+
/* @__PURE__ */ jsx(Title, { order: 4, children: "Initial Draft" }),
|
|
5150
|
+
/* @__PURE__ */ jsx(Card, { withBorder: true, style: { maxHeight: 300, overflowY: "auto" }, children: /* @__PURE__ */ jsx(Text, { size: "sm", style: { whiteSpace: "pre-wrap" }, children: post.initial_draft }) })
|
|
5151
|
+
] }),
|
|
5152
|
+
post.status === "skipped" ? /* @__PURE__ */ jsx(
|
|
5153
|
+
Textarea,
|
|
5154
|
+
{
|
|
5155
|
+
label: "Skip Reason",
|
|
5156
|
+
placeholder: "Why was this post skipped?",
|
|
5157
|
+
autosize: true,
|
|
5158
|
+
minRows: 2,
|
|
5159
|
+
value: skipReason,
|
|
5160
|
+
onChange: (e) => setSkipReason(e.currentTarget.value),
|
|
5161
|
+
onBlur: () => {
|
|
5162
|
+
const val = skipReason.trim();
|
|
5163
|
+
if (val !== (post.skip_reason ?? "")) {
|
|
5164
|
+
updatePost.mutate({ skip_reason: val || null });
|
|
5165
|
+
}
|
|
5166
|
+
}
|
|
5167
|
+
}
|
|
5168
|
+
) : /* @__PURE__ */ jsx(
|
|
5169
|
+
Textarea,
|
|
5170
|
+
{
|
|
5171
|
+
label: "Final Response",
|
|
5172
|
+
placeholder: "Edit response before posting",
|
|
5173
|
+
autosize: true,
|
|
5174
|
+
minRows: 2,
|
|
5175
|
+
value: finalResponse,
|
|
5176
|
+
onChange: (e) => setFinalResponse(e.currentTarget.value),
|
|
5177
|
+
onBlur: () => {
|
|
5178
|
+
const val = finalResponse.trim();
|
|
5179
|
+
if (val !== (post.final_response ?? "")) {
|
|
5180
|
+
updatePost.mutate({ final_response: val || null });
|
|
5181
|
+
}
|
|
5182
|
+
}
|
|
5183
|
+
}
|
|
5184
|
+
),
|
|
5185
|
+
/* @__PURE__ */ jsx(
|
|
5186
|
+
Textarea,
|
|
5187
|
+
{
|
|
5188
|
+
label: "Feedback",
|
|
5189
|
+
description: "Inform the AI what was good/bad about this post's score or draft",
|
|
5190
|
+
placeholder: "e.g. Score too high \u2014 post is generic, not a real lead",
|
|
5191
|
+
autosize: true,
|
|
5192
|
+
minRows: 2,
|
|
5193
|
+
value: feedback,
|
|
5194
|
+
onChange: (e) => setFeedback(e.currentTarget.value),
|
|
5195
|
+
onBlur: () => {
|
|
5196
|
+
const val = feedback.trim();
|
|
5197
|
+
if (val !== (post.feedback ?? "")) {
|
|
5198
|
+
updatePost.mutate({ feedback: val || null });
|
|
5199
|
+
}
|
|
5200
|
+
}
|
|
5201
|
+
}
|
|
5202
|
+
)
|
|
5203
|
+
] }) }),
|
|
5204
|
+
post.platform === "reddit" && !!metadata.selftext && /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
5205
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: "Post Body" }),
|
|
5206
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
5207
|
+
/* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsx(Text, { size: "sm", style: { whiteSpace: "pre-wrap" }, children: String(metadata.selftext) }) })
|
|
5208
|
+
] }) }),
|
|
5209
|
+
/* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
|
|
5210
|
+
/* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
5211
|
+
/* @__PURE__ */ jsx(
|
|
5212
|
+
Button,
|
|
5213
|
+
{
|
|
5214
|
+
variant: "light",
|
|
5215
|
+
color: "var(--color-primary)",
|
|
5216
|
+
size: "xs",
|
|
5217
|
+
leftSection: /* @__PURE__ */ jsx(IconChevronLeft, { size: 14 }),
|
|
5218
|
+
disabled: !prevId,
|
|
5219
|
+
onClick: () => prevId && navigateToPost(prevId),
|
|
5220
|
+
children: "Previous"
|
|
5221
|
+
}
|
|
5222
|
+
),
|
|
5223
|
+
/* @__PURE__ */ jsx(
|
|
5224
|
+
Button,
|
|
5225
|
+
{
|
|
5226
|
+
variant: "light",
|
|
5227
|
+
color: "var(--color-primary)",
|
|
5228
|
+
size: "xs",
|
|
5229
|
+
rightSection: /* @__PURE__ */ jsx(IconChevronRight, { size: 14 }),
|
|
5230
|
+
disabled: !nextId,
|
|
5231
|
+
onClick: () => nextId && navigateToPost(nextId),
|
|
5232
|
+
children: "Next"
|
|
5233
|
+
}
|
|
5234
|
+
)
|
|
5235
|
+
] }),
|
|
5236
|
+
updatePost.isPending ? /* @__PURE__ */ jsx(Loader, { size: 16 }) : showSaved ? /* @__PURE__ */ jsxs(Group, { gap: 4, children: [
|
|
5237
|
+
/* @__PURE__ */ jsx(IconCheck, { size: 16, color: "var(--mantine-color-green-6)" }),
|
|
5238
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "green", children: "Saved" })
|
|
5239
|
+
] }) : null
|
|
5240
|
+
] })
|
|
5241
|
+
] });
|
|
4519
5242
|
}
|
|
4520
5243
|
|
|
4521
|
-
export { LEAD_GEN_ROUTE_LINKS, LeadGenCompaniesPage, LeadGenContactsPage, LeadGenListDetailPage, LeadGenListsPage, LeadGenOverviewPage, LeadGenRouteShell, LeadGenSidebar, LeadGenSidebarTop, ListBuilderIndexPage, ListBuilderPage, ORPHAN_STAGE_ORDER, StepConfigForm, TabSection, deriveBusinessProgress, formatDate, getEnrichmentColor, getEnrichmentStatus, getLeadGenApiInterfaceReadiness, getLeadGenExportWorkflowId, getStateKeyColor, getStatusColor, getStepActionLabel, isLeadGenExportAction, resolveBuildPlanSteps, resolveBuildState, sortStageKeys, useDeleteLists, useLeadGenConfig };
|
|
5244
|
+
export { LEAD_GEN_ROUTE_LINKS, LeadGenCompaniesPage, LeadGenContactsPage, LeadGenListDetailPage, LeadGenListsPage, LeadGenOverviewPage, LeadGenRouteShell, LeadGenSidebar, LeadGenSidebarTop, ListBuilderIndexPage, ListBuilderPage, ORPHAN_STAGE_ORDER, SocialMonitoringPage, SocialPostDetailPage, StepConfigForm, TabSection, deriveBusinessProgress, formatDate, getEnrichmentColor, getEnrichmentStatus, getLeadGenApiInterfaceReadiness, getLeadGenExportWorkflowId, getStateKeyColor, getStatusColor, getStepActionLabel, isLeadGenExportAction, resolveBuildPlanSteps, resolveBuildState, socialPostDetailKeys, socialPostKeys, sortStageKeys, useAdjacentPosts, useDeleteLists, useDeleteSocialPost, useLeadGenConfig, useSocialPost, useSocialPosts, useUpdateSocialPost };
|