@elevasis/ui 2.0.3 → 2.2.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/{chunk-QRHLV74B.js → chunk-2JTCPVZX.js} +2 -2
- package/dist/{chunk-H762MTQ5.js → chunk-7IE3KXKV.js} +4 -4
- package/dist/{chunk-PQNEE57X.js → chunk-BIZNOFO4.js} +2 -2
- package/dist/{chunk-TZOGB3X4.js → chunk-J5TBNCMD.js} +250 -1
- package/dist/{chunk-PRLXFMNP.js → chunk-JT3FN6TE.js} +1 -1
- package/dist/{chunk-MVJ4TSSA.js → chunk-MXVA7U2I.js} +2 -2
- package/dist/{chunk-OKKGD3S6.js → chunk-PFONCU6C.js} +1 -1
- package/dist/components/index.d.ts +112 -1
- package/dist/components/index.js +2134 -46
- package/dist/features/dashboard/index.js +3 -3
- package/dist/features/monitoring/index.js +4 -4
- package/dist/features/operations/index.js +5 -5
- package/dist/features/settings/index.js +3 -3
- package/dist/hooks/index.d.ts +299 -2
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/published.d.ts +299 -2
- package/dist/hooks/published.js +1 -1
- package/dist/index.d.ts +299 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { useBreadcrumbs } from '../chunk-MG3NF7QL.js';
|
|
2
2
|
import '../chunk-SMJLS23U.js';
|
|
3
|
-
import { NotificationList } from '../chunk-
|
|
4
|
-
export { ActivityCard, ActivityFilters as ActivityFiltersBar, ActivityTable, BusinessImpactCard, CostBreakdownCard, CostByModelTable, CostMetricsCard, ErrorAnalysisCard, ErrorBreakdownTable, ExecutionBreakdownTable, ExecutionHealthCard, ExecutionLogsFilters as ExecutionLogsFilterBar, ExecutionLogsTable, NotificationItem, NotificationList, monitoringManifest } from '../chunk-
|
|
5
|
-
export { CreateCredentialModal, CredentialList, CredentialSettings, MembershipFeaturePanel, MembershipStatusBadge, OAuthConnectModal, OrganizationMembershipsList, WebhookUrlDisplayModal, settingsManifest } from '../chunk-
|
|
3
|
+
import { NotificationList } from '../chunk-2JTCPVZX.js';
|
|
4
|
+
export { ActivityCard, ActivityFilters as ActivityFiltersBar, ActivityTable, BusinessImpactCard, CostBreakdownCard, CostByModelTable, CostMetricsCard, ErrorAnalysisCard, ErrorBreakdownTable, ExecutionBreakdownTable, ExecutionHealthCard, ExecutionLogsFilters as ExecutionLogsFilterBar, ExecutionLogsTable, NotificationItem, NotificationList, monitoringManifest } from '../chunk-2JTCPVZX.js';
|
|
5
|
+
export { CreateCredentialModal, CredentialList, CredentialSettings, MembershipFeaturePanel, MembershipStatusBadge, OAuthConnectModal, OrganizationMembershipsList, WebhookUrlDisplayModal, settingsManifest } from '../chunk-MXVA7U2I.js';
|
|
6
6
|
import { FilterBar } from '../chunk-PDHTXPSF.js';
|
|
7
7
|
export { FilterBar } from '../chunk-PDHTXPSF.js';
|
|
8
|
-
|
|
8
|
+
import { ResourceExecuteDialog } from '../chunk-7IE3KXKV.js';
|
|
9
|
+
export { ActionModal, AgentDefinitionDisplay, AgentExecutionLogs, BaseExecutionLogs, BaseExecutionLogsHeader, BaseExecutionLogsStates, CheckpointGroup, CollapsibleJsonSection, CommandQueueSidebar, CommandQueueSidebarMiddle, CommandQueueSidebarTop, CommandQueueTaskRow, CommandViewEdge, CommandViewGraph, CommandViewNode, ConfigCard, ContentSections, ContextUsageBadge, ContractDisplay, ExecutionErrorSection, FormFieldRenderer, LogEntry, LogGroup, NewKnowledgeMapEdge, NewKnowledgeMapGraph, NewKnowledgeMapNode, OperationsSidebar, OperationsSidebarMiddle, OperationsSidebarTop, ResourceDefinitionSection, ResourceErrorState, ResourceFilter, ResourceHeader, ResourceNotFoundState, SessionMemory, ToolsListDisplay, WorkflowDefinitionDisplay, WorkflowExecutionLogs, getExecutionStatusConfig, getIcon, getLogLevelConfig, iconMap, operationsManifest, useNewKnowledgeMapLayout } from '../chunk-7IE3KXKV.js';
|
|
9
10
|
import '../chunk-ROSMICXG.js';
|
|
10
11
|
import { SubshellLoader, PageContainer, SubshellSidebarSection, SubshellNavItem, CollapsibleSidebarGroup } from '../chunk-OCP2MBTY.js';
|
|
11
|
-
export { ResourceHealthPanel } from '../chunk-
|
|
12
|
+
export { ResourceHealthPanel } from '../chunk-PFONCU6C.js';
|
|
12
13
|
import { CustomModal } from '../chunk-GBMNCNHX.js';
|
|
13
14
|
export { ConfirmationInputModal, ConfirmationModal, CustomModal } from '../chunk-GBMNCNHX.js';
|
|
14
|
-
export { AgentExecutionTimeline, AgentExecutionVisualizer, AgentIterationEdge, AgentIterationNode, BaseEdge, BaseNode, EmptyVisualizer, ExecutionStats, ExecutionStatusBadge, GraphBackground, GraphContainer, GraphFitViewButton, GraphFitViewHandler, GraphLegend, TimelineAxis, TimelineBar, TimelineContainer, TimelineRow, UnifiedWorkflowEdge, UnifiedWorkflowGraph, UnifiedWorkflowNode, VisualizerContainer, WorkflowExecutionTimeline, dashboardManifest, getGraphBackgroundStyles, useGraphBackgroundStyles, useGraphTheme } from '../chunk-
|
|
15
|
+
export { AgentExecutionTimeline, AgentExecutionVisualizer, AgentIterationEdge, AgentIterationNode, BaseEdge, BaseNode, EmptyVisualizer, ExecutionStats, ExecutionStatusBadge, GraphBackground, GraphContainer, GraphFitViewButton, GraphFitViewHandler, GraphLegend, TimelineAxis, TimelineBar, TimelineContainer, TimelineRow, UnifiedWorkflowEdge, UnifiedWorkflowGraph, UnifiedWorkflowNode, VisualizerContainer, WorkflowExecutionTimeline, dashboardManifest, getGraphBackgroundStyles, useGraphBackgroundStyles, useGraphTheme } from '../chunk-BIZNOFO4.js';
|
|
15
16
|
export { ResourceHealthChart, getHealthColor } from '../chunk-LGKLC5MG.js';
|
|
16
17
|
import '../chunk-KFICYU6S.js';
|
|
17
18
|
import { AppShellLoader } from '../chunk-YEX4MQSY.js';
|
|
18
19
|
import '../chunk-35QO7M43.js';
|
|
19
|
-
import { useUpdateApiKey, useDeleteApiKey, useCreateApiKey, useListApiKeys, useActivateDeployment, useDeactivateDeployment, useDeleteDeployment, useListDeployments } from '../chunk-
|
|
20
|
-
import { usePaginationState, useDeploymentDocs, useResources, useCreateSchedule, useListSchedules, usePauseSchedule, useResumeSchedule, useCancelSchedule, useDeleteSchedule, useDealNotes, useCreateDealNote, useDeals, useSyncDealStage, dealKeys, useDealTasksDue, useCreateDealTask,
|
|
21
|
-
export { showApiErrorNotification, showErrorNotification, showInfoNotification, showSuccessNotification, showWarningNotification } from '../chunk-
|
|
20
|
+
import { useUpdateApiKey, useDeleteApiKey, useCreateApiKey, useListApiKeys, useActivateDeployment, useDeactivateDeployment, useDeleteDeployment, useListDeployments, useProjects } from '../chunk-JT3FN6TE.js';
|
|
21
|
+
import { usePaginationState, useDeploymentDocs, useResources, useCreateSchedule, useListSchedules, usePauseSchedule, useResumeSchedule, useCancelSchedule, useDeleteSchedule, useDealNotes, useCreateDealNote, useDeals, useSyncDealStage, dealKeys, useDealTasksDue, useCreateDealTask, useDeleteDeal, useTableSort, sortData, useTableSelection, useDealDetail, showApiErrorNotification, acquisitionListKeys, showSuccessNotification, useListsTelemetry, useLists, useCreateList, useList, useListProgress, useListExecutions, useResourceDefinition, useCompanies, useDeleteCompanies, useContacts, useDeleteContacts, useDeleteProject, useMarkAllAsRead, useNotifications, showErrorNotification } from '../chunk-J5TBNCMD.js';
|
|
22
|
+
export { showApiErrorNotification, showErrorNotification, showInfoNotification, showSuccessNotification, showWarningNotification } from '../chunk-J5TBNCMD.js';
|
|
22
23
|
import '../chunk-LXHZYSMQ.js';
|
|
23
24
|
export { Graph_module_css_default as graphStyles } from '../chunk-F6RBK7NJ.js';
|
|
24
25
|
export { CONTAINER_CONSTANTS, SHARED_VIZ_CONSTANTS } from '../chunk-XA34RETF.js';
|
|
@@ -46,12 +47,12 @@ import '../chunk-DD3CCMCZ.js';
|
|
|
46
47
|
import { useElevasisServices } from '../chunk-QEPXAWE2.js';
|
|
47
48
|
import '../chunk-BRJ3QZ4E.js';
|
|
48
49
|
import { useRouterContext } from '../chunk-Q7DJKLEN.js';
|
|
49
|
-
import { Table, Group, Text, Button, Stack, Title, TextInput, Alert, Tooltip, ActionIcon, Paper, Code, CopyButton, SimpleGrid, Badge, Loader, Pagination, useMantineTheme, Box, ScrollArea, Select, Center, Card, SegmentedControl, Switch, Textarea, Divider, Menu, Timeline, ThemeIcon, Tabs, Anchor, Breadcrumbs as Breadcrumbs$1, Drawer, UnstyledButton, Modal, RingProgress, Collapse, Popover, Indicator } from '@mantine/core';
|
|
50
|
-
import { IconAddressBook, IconBriefcase, IconTarget, IconChevronUp, IconChevronDown, IconSelector, IconTrash, IconPencil, IconAlertCircle, IconKey, IconCalendar, IconClock, IconAlertTriangle, IconExclamationMark, IconShieldLock, IconCheck, IconCopy, IconPlus, IconRocket, IconRefresh, IconPower, IconPlayerPlay, IconCircleCheck, IconTag, IconBook2, IconFileOff, IconList, IconCalendarRepeat, IconCalendarEvent, IconCalendarTime, IconRobot, IconGitBranch, IconSettings, IconExternalLink, IconDotsVertical, IconPlayerPause, IconPlayerStop, IconCalendarDue, IconCalendarStats, IconCalendarOff, IconListCheck, IconTrophy, IconClockExclamation, IconUser, IconLayoutGrid, IconColumns, IconFileInvoice, IconChecklist, IconHistory, IconBuilding, IconMailCheck,
|
|
50
|
+
import { Table, Group, Text, Button, Stack, Title, TextInput, Alert, Tooltip, ActionIcon, Paper, Code, CopyButton, SimpleGrid, Badge, Loader, Pagination, useMantineTheme, Box, ScrollArea, Select, Center, Card, SegmentedControl, Switch, Textarea, Divider, Menu, Timeline, ThemeIcon, Tabs, Anchor, Breadcrumbs as Breadcrumbs$1, Drawer, UnstyledButton, Modal, Checkbox, RingProgress, Collapse, Popover, Indicator } from '@mantine/core';
|
|
51
|
+
import { IconAddressBook, IconBriefcase, IconTarget, IconChevronUp, IconChevronDown, IconSelector, IconTrash, IconPencil, IconAlertCircle, IconKey, IconCalendar, IconClock, IconAlertTriangle, IconExclamationMark, IconShieldLock, IconCheck, IconCopy, IconPlus, IconRocket, IconRefresh, IconPower, IconPlayerPlay, IconCircleCheck, IconTag, IconBook2, IconFileOff, IconList, IconCalendarRepeat, IconCalendarEvent, IconCalendarTime, IconRobot, IconGitBranch, IconSettings, IconExternalLink, IconDotsVertical, IconPlayerPause, IconPlayerStop, IconCalendarDue, IconCalendarStats, IconCalendarOff, IconListCheck, IconTrophy, IconClockExclamation, IconUser, IconLayoutGrid, IconColumns, IconFileInvoice, IconChecklist, IconHistory, IconSearch, IconTargetArrow, IconArrowLeft, IconFileText, IconX, IconBuilding, IconMailCheck, IconChartBar, IconBuildingFactory2, IconUsers, IconQuestionMark, IconSparkles, IconClockHour4, IconTrendingUp, IconHeartbeat, IconFlag, IconInbox, IconLock, IconChevronRight, IconDownload, IconMessageCircle, IconBell, IconNotes, IconFolderOpen, IconFolder, IconCheckbox, IconMail, IconPhone, IconArrowRight, IconNote } from '@tabler/icons-react';
|
|
51
52
|
import * as runtime from 'react/jsx-runtime';
|
|
52
53
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
53
54
|
import { useDisclosure } from '@mantine/hooks';
|
|
54
|
-
import { useQueryClient, useQuery } from '@tanstack/react-query';
|
|
55
|
+
import { useQueryClient, useQuery, useMutation } from '@tanstack/react-query';
|
|
55
56
|
import { useState, useEffect, useMemo, useCallback, useRef } from 'react';
|
|
56
57
|
import { useForm } from '@mantine/form';
|
|
57
58
|
import { Link, RichTextEditor as RichTextEditor$1 } from '@mantine/tiptap';
|
|
@@ -60,6 +61,7 @@ import Placeholder from '@tiptap/extension-placeholder';
|
|
|
60
61
|
import StarterKit from '@tiptap/starter-kit';
|
|
61
62
|
import { Prism } from 'react-syntax-highlighter';
|
|
62
63
|
import { oneDark } from 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
64
|
+
import { useNavigate, Link as Link$1 } from '@tanstack/react-router';
|
|
63
65
|
|
|
64
66
|
function SortableHeader({ column, children, sort, onToggle, style, w }) {
|
|
65
67
|
const isActive = sort.column === column;
|
|
@@ -3019,7 +3021,7 @@ function MdxRenderer({ compiledSource }) {
|
|
|
3019
3021
|
return /* @__PURE__ */ jsx(Content, { components: mdxComponents });
|
|
3020
3022
|
}
|
|
3021
3023
|
var Breadcrumbs = ({ navItems }) => {
|
|
3022
|
-
const { Link:
|
|
3024
|
+
const { Link: Link4 } = useRouterContext();
|
|
3023
3025
|
const breadcrumbs = useBreadcrumbs({ navItems });
|
|
3024
3026
|
const items = breadcrumbs.map((item) => {
|
|
3025
3027
|
const isActive = item.isActive;
|
|
@@ -3029,7 +3031,7 @@ var Breadcrumbs = ({ navItems }) => {
|
|
|
3029
3031
|
return item.path ? /* @__PURE__ */ jsx(
|
|
3030
3032
|
Anchor,
|
|
3031
3033
|
{
|
|
3032
|
-
component:
|
|
3034
|
+
component: Link4,
|
|
3033
3035
|
to: item.path,
|
|
3034
3036
|
size: "sm",
|
|
3035
3037
|
style: {
|
|
@@ -4072,6 +4074,410 @@ var crmManifest = {
|
|
|
4072
4074
|
featureKey: "acquisition"
|
|
4073
4075
|
}
|
|
4074
4076
|
};
|
|
4077
|
+
|
|
4078
|
+
// src/features/crm/pages/shared.ts
|
|
4079
|
+
var DEAL_STAGE_COLORS = {
|
|
4080
|
+
interested: "blue",
|
|
4081
|
+
proposal: "yellow",
|
|
4082
|
+
closing: "orange",
|
|
4083
|
+
closed_won: "green",
|
|
4084
|
+
closed_lost: "red",
|
|
4085
|
+
nurturing: "grape"
|
|
4086
|
+
};
|
|
4087
|
+
var DEAL_STAGE_OPTIONS = [
|
|
4088
|
+
{ value: "interested", label: "Interested" },
|
|
4089
|
+
{ value: "proposal", label: "Proposal" },
|
|
4090
|
+
{ value: "closing", label: "Closing" },
|
|
4091
|
+
{ value: "closed_won", label: "Closed Won" },
|
|
4092
|
+
{ value: "closed_lost", label: "Closed Lost" },
|
|
4093
|
+
{ value: "nurturing", label: "Nurturing" }
|
|
4094
|
+
];
|
|
4095
|
+
function formatDealStageLabel(stage) {
|
|
4096
|
+
if (!stage) return "Unknown";
|
|
4097
|
+
return stage.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
4098
|
+
}
|
|
4099
|
+
var sortAccessors = {
|
|
4100
|
+
company: (deal) => deal.contact?.company?.name || deal.discovery_data?.company || deal.contact_email?.split("@")[1] || "",
|
|
4101
|
+
contact: (deal) => [deal.contact?.first_name, deal.contact?.last_name].filter(Boolean).join(" ") || "",
|
|
4102
|
+
email: (deal) => deal.contact_email || "",
|
|
4103
|
+
stage: (deal) => deal.cached_stage || "",
|
|
4104
|
+
updated: (deal) => deal.updated_at || ""
|
|
4105
|
+
};
|
|
4106
|
+
function DealsListPage() {
|
|
4107
|
+
const navigate = useNavigate();
|
|
4108
|
+
const queryClient = useQueryClient();
|
|
4109
|
+
const deleteDeal = useDeleteDeal();
|
|
4110
|
+
const [stageFilter, setStageFilter] = useState(null);
|
|
4111
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
4112
|
+
const [showBatchDelete, setShowBatchDelete] = useState(false);
|
|
4113
|
+
const { data: deals, isLoading, error } = useDeals({
|
|
4114
|
+
stage: stageFilter || void 0,
|
|
4115
|
+
search: searchQuery || void 0
|
|
4116
|
+
});
|
|
4117
|
+
const { sort, toggleSort } = useTableSort("updated");
|
|
4118
|
+
const sortedDeals = useMemo(() => sortData(deals ?? [], sort, sortAccessors), [deals, sort]);
|
|
4119
|
+
const pagination = usePaginationState(PAGE_SIZE_DEFAULT, [stageFilter, searchQuery], sortedDeals.length);
|
|
4120
|
+
const paginatedDeals = useMemo(
|
|
4121
|
+
() => sortedDeals.slice(pagination.offset, pagination.offset + PAGE_SIZE_DEFAULT),
|
|
4122
|
+
[sortedDeals, pagination.offset]
|
|
4123
|
+
);
|
|
4124
|
+
const selection = useTableSelection(paginatedDeals, sortedDeals);
|
|
4125
|
+
const handleDeleteSelected = async () => {
|
|
4126
|
+
await Promise.all([...selection.selectedIds].map((dealId) => deleteDeal.mutateAsync(dealId)));
|
|
4127
|
+
setShowBatchDelete(false);
|
|
4128
|
+
selection.clear();
|
|
4129
|
+
await queryClient.invalidateQueries({ queryKey: ["deals"] });
|
|
4130
|
+
};
|
|
4131
|
+
return /* @__PURE__ */ jsxs(SubshellContentContainer, { children: [
|
|
4132
|
+
/* @__PURE__ */ jsxs(PageContainer, { children: [
|
|
4133
|
+
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title: "Deals", caption: "Deal pipeline and stage tracking" }) }),
|
|
4134
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
4135
|
+
/* @__PURE__ */ jsxs(
|
|
4136
|
+
FilterBar,
|
|
4137
|
+
{
|
|
4138
|
+
actions: /* @__PURE__ */ jsx(
|
|
4139
|
+
TableSelectionToolbar,
|
|
4140
|
+
{
|
|
4141
|
+
selectedCount: selection.selectedCount,
|
|
4142
|
+
onDelete: () => setShowBatchDelete(true),
|
|
4143
|
+
isDeleting: deleteDeal.isPending
|
|
4144
|
+
}
|
|
4145
|
+
),
|
|
4146
|
+
children: [
|
|
4147
|
+
/* @__PURE__ */ jsx(
|
|
4148
|
+
Select,
|
|
4149
|
+
{
|
|
4150
|
+
placeholder: "All Stages",
|
|
4151
|
+
data: DEAL_STAGE_OPTIONS,
|
|
4152
|
+
style: { minWidth: 180 },
|
|
4153
|
+
size: "sm",
|
|
4154
|
+
clearable: true,
|
|
4155
|
+
value: stageFilter,
|
|
4156
|
+
onChange: (value) => setStageFilter(value ?? null)
|
|
4157
|
+
}
|
|
4158
|
+
),
|
|
4159
|
+
/* @__PURE__ */ jsx(
|
|
4160
|
+
TextInput,
|
|
4161
|
+
{
|
|
4162
|
+
placeholder: "Search by email...",
|
|
4163
|
+
leftSection: /* @__PURE__ */ jsx(IconSearch, { size: 16 }),
|
|
4164
|
+
style: { minWidth: 250 },
|
|
4165
|
+
size: "sm",
|
|
4166
|
+
value: searchQuery,
|
|
4167
|
+
onChange: (e) => setSearchQuery(e.currentTarget.value)
|
|
4168
|
+
}
|
|
4169
|
+
)
|
|
4170
|
+
]
|
|
4171
|
+
}
|
|
4172
|
+
),
|
|
4173
|
+
isLoading ? /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) : error ? /* @__PURE__ */ jsx(CenteredErrorState, { error, title: "Failed to load deals" }) : !sortedDeals.length ? /* @__PURE__ */ jsx(EmptyState, { icon: IconTargetArrow, title: "No deals found" }) : /* @__PURE__ */ jsxs(Table, { children: [
|
|
4174
|
+
/* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
4175
|
+
/* @__PURE__ */ jsx(Table.Th, { w: 40, children: /* @__PURE__ */ jsx(
|
|
4176
|
+
Checkbox,
|
|
4177
|
+
{
|
|
4178
|
+
checked: selection.isPageAllSelected,
|
|
4179
|
+
indeterminate: selection.isPagePartiallySelected,
|
|
4180
|
+
onChange: selection.togglePage
|
|
4181
|
+
}
|
|
4182
|
+
) }),
|
|
4183
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "company", sort, onToggle: toggleSort, children: "Company" }),
|
|
4184
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "contact", sort, onToggle: toggleSort, children: "Contact" }),
|
|
4185
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "email", sort, onToggle: toggleSort, children: "Email" }),
|
|
4186
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "stage", sort, onToggle: toggleSort, children: "Stage" }),
|
|
4187
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "updated", sort, onToggle: toggleSort, children: "Updated" })
|
|
4188
|
+
] }) }),
|
|
4189
|
+
/* @__PURE__ */ jsx(Table.Tbody, { children: paginatedDeals.map((deal) => {
|
|
4190
|
+
const discoveryData = deal.discovery_data;
|
|
4191
|
+
const companyName = deal.contact?.company?.name || discoveryData?.company || deal.contact_email?.split("@")[1] || "-";
|
|
4192
|
+
const contactName = [deal.contact?.first_name, deal.contact?.last_name].filter(Boolean).join(" ");
|
|
4193
|
+
return /* @__PURE__ */ jsxs(
|
|
4194
|
+
Table.Tr,
|
|
4195
|
+
{
|
|
4196
|
+
style: { cursor: "pointer" },
|
|
4197
|
+
onClick: () => navigate({
|
|
4198
|
+
to: "/crm/deals/$dealId",
|
|
4199
|
+
params: { dealId: deal.id }
|
|
4200
|
+
}),
|
|
4201
|
+
children: [
|
|
4202
|
+
/* @__PURE__ */ jsx(Table.Td, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(
|
|
4203
|
+
Checkbox,
|
|
4204
|
+
{
|
|
4205
|
+
checked: selection.isSelected(deal.id),
|
|
4206
|
+
onChange: () => selection.toggle(deal.id)
|
|
4207
|
+
}
|
|
4208
|
+
) }),
|
|
4209
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { fw: 500, children: companyName }) }),
|
|
4210
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", children: contactName || "-" }) }),
|
|
4211
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: deal.contact_email || "-" }) }),
|
|
4212
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { variant: "light", color: DEAL_STAGE_COLORS[deal.cached_stage || ""] || "gray", size: "sm", children: formatDealStageLabel(deal.cached_stage) }) }),
|
|
4213
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: formatTimeAgo(deal.updated_at) }) })
|
|
4214
|
+
]
|
|
4215
|
+
},
|
|
4216
|
+
deal.id
|
|
4217
|
+
);
|
|
4218
|
+
}) })
|
|
4219
|
+
] }),
|
|
4220
|
+
sortedDeals.length > PAGE_SIZE_DEFAULT && /* @__PURE__ */ jsx(Group, { justify: "center", children: /* @__PURE__ */ jsx(
|
|
4221
|
+
Pagination,
|
|
4222
|
+
{
|
|
4223
|
+
value: pagination.page,
|
|
4224
|
+
onChange: pagination.setPage,
|
|
4225
|
+
total: pagination.totalPages(sortedDeals.length),
|
|
4226
|
+
size: "sm"
|
|
4227
|
+
}
|
|
4228
|
+
) })
|
|
4229
|
+
] }) })
|
|
4230
|
+
] }),
|
|
4231
|
+
/* @__PURE__ */ jsx(
|
|
4232
|
+
CustomModal,
|
|
4233
|
+
{
|
|
4234
|
+
opened: showBatchDelete,
|
|
4235
|
+
onClose: () => !deleteDeal.isPending && setShowBatchDelete(false),
|
|
4236
|
+
size: "sm",
|
|
4237
|
+
loading: deleteDeal.isPending,
|
|
4238
|
+
children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
4239
|
+
/* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
|
|
4240
|
+
/* @__PURE__ */ jsx(IconAlertTriangle, { size: 24, color: "var(--color-error)" }),
|
|
4241
|
+
/* @__PURE__ */ jsxs(Title, { order: 4, children: [
|
|
4242
|
+
"Delete ",
|
|
4243
|
+
selection.selectedCount,
|
|
4244
|
+
" Deals"
|
|
4245
|
+
] })
|
|
4246
|
+
] }),
|
|
4247
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
4248
|
+
"Are you sure you want to delete",
|
|
4249
|
+
" ",
|
|
4250
|
+
/* @__PURE__ */ jsx(Text, { span: true, fw: 600, children: selection.selectedCount }),
|
|
4251
|
+
" ",
|
|
4252
|
+
"selected deals?"
|
|
4253
|
+
] }),
|
|
4254
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "This action cannot be undone." }),
|
|
4255
|
+
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", mt: "md", children: [
|
|
4256
|
+
/* @__PURE__ */ jsx(Button, { variant: "light", onClick: () => setShowBatchDelete(false), disabled: deleteDeal.isPending, children: "Cancel" }),
|
|
4257
|
+
/* @__PURE__ */ jsx(Button, { color: "red", loading: deleteDeal.isPending, onClick: () => void handleDeleteSelected(), children: "Delete" })
|
|
4258
|
+
] })
|
|
4259
|
+
] })
|
|
4260
|
+
}
|
|
4261
|
+
)
|
|
4262
|
+
] });
|
|
4263
|
+
}
|
|
4264
|
+
function DealDetailPage({ dealId, renderActions, onDealLoaded }) {
|
|
4265
|
+
const navigate = useNavigate();
|
|
4266
|
+
const deleteDeal = useDeleteDeal();
|
|
4267
|
+
const { data: deal, isLoading, error } = useDealDetail(dealId);
|
|
4268
|
+
const [deleteModalOpen, setDeleteModalOpen] = useState(false);
|
|
4269
|
+
useEffect(() => {
|
|
4270
|
+
if (deal) onDealLoaded?.(deal);
|
|
4271
|
+
}, [deal, onDealLoaded]);
|
|
4272
|
+
const title = deal ? `${[deal.contact?.first_name, deal.contact?.last_name].filter(Boolean).join(" ") || "Unknown"} Deal` : "Deal Detail";
|
|
4273
|
+
const contactName = useMemo(
|
|
4274
|
+
() => deal ? [deal.contact?.first_name, deal.contact?.last_name].filter(Boolean).join(" ") : "",
|
|
4275
|
+
[deal]
|
|
4276
|
+
);
|
|
4277
|
+
const companyName = useMemo(() => {
|
|
4278
|
+
if (!deal) return null;
|
|
4279
|
+
return deal.contact?.company?.name || deal.discovery_data?.company || deal.contact_email?.split("@")[1] || "Unknown";
|
|
4280
|
+
}, [deal]);
|
|
4281
|
+
const headerActions = deal ? /* @__PURE__ */ jsxs(Group, { children: [
|
|
4282
|
+
/* @__PURE__ */ jsx(
|
|
4283
|
+
Button,
|
|
4284
|
+
{
|
|
4285
|
+
variant: "light",
|
|
4286
|
+
size: "sm",
|
|
4287
|
+
leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }),
|
|
4288
|
+
onClick: () => navigate({ to: "/crm/deals" }),
|
|
4289
|
+
children: "Deals"
|
|
4290
|
+
}
|
|
4291
|
+
),
|
|
4292
|
+
deal.proposal_pdf_url && /* @__PURE__ */ jsx(
|
|
4293
|
+
Button,
|
|
4294
|
+
{
|
|
4295
|
+
variant: "light",
|
|
4296
|
+
leftSection: /* @__PURE__ */ jsx(IconFileText, { size: 16 }),
|
|
4297
|
+
onClick: () => window.open(deal.proposal_pdf_url, "_blank"),
|
|
4298
|
+
children: "View Proposal"
|
|
4299
|
+
}
|
|
4300
|
+
),
|
|
4301
|
+
renderActions?.(deal),
|
|
4302
|
+
/* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", color: "red", onClick: () => setDeleteModalOpen(true), children: /* @__PURE__ */ jsx(IconTrash, { size: 16 }) })
|
|
4303
|
+
] }) : /* @__PURE__ */ jsx(Button, { variant: "light", size: "sm", leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }), onClick: () => navigate({ to: "/crm/deals" }), children: "Deals" });
|
|
4304
|
+
if (isLoading) {
|
|
4305
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
|
|
4306
|
+
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title, caption: "Loading deal details...", rightSection: headerActions }) }),
|
|
4307
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) })
|
|
4308
|
+
] }) });
|
|
4309
|
+
}
|
|
4310
|
+
if (error) {
|
|
4311
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
|
|
4312
|
+
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title, caption: "Unable to load deal details", rightSection: headerActions }) }),
|
|
4313
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(CenteredErrorState, { error, title: "Failed to load deal" }) })
|
|
4314
|
+
] }) });
|
|
4315
|
+
}
|
|
4316
|
+
if (!deal) {
|
|
4317
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
|
|
4318
|
+
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title, caption: "Deal not found", rightSection: headerActions }) }),
|
|
4319
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(EmptyState, { icon: IconTrash, title: "Deal not found", description: "The selected deal no longer exists." }) })
|
|
4320
|
+
] }) });
|
|
4321
|
+
}
|
|
4322
|
+
const activityLog = deal.activity_log || [];
|
|
4323
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
|
|
4324
|
+
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(
|
|
4325
|
+
PageTitleCaption,
|
|
4326
|
+
{
|
|
4327
|
+
title,
|
|
4328
|
+
caption: `${companyName || "Unknown"} - ${formatDealStageLabel(deal.cached_stage)}`,
|
|
4329
|
+
rightSection: headerActions
|
|
4330
|
+
}
|
|
4331
|
+
) }),
|
|
4332
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsxs(Tabs, { defaultValue: "details", children: [
|
|
4333
|
+
/* @__PURE__ */ jsxs(Tabs.List, { children: [
|
|
4334
|
+
/* @__PURE__ */ jsx(Tabs.Tab, { value: "details", children: "Details" }),
|
|
4335
|
+
/* @__PURE__ */ jsx(Tabs.Tab, { value: "discovery", children: "Discovery Data" }),
|
|
4336
|
+
/* @__PURE__ */ jsx(Tabs.Tab, { value: "activity", children: "Activity" })
|
|
4337
|
+
] }),
|
|
4338
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { value: "details", pt: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
4339
|
+
/* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
4340
|
+
/* @__PURE__ */ jsx(Title, { order: 4, children: "Deal" }),
|
|
4341
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4342
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Stage:" }),
|
|
4343
|
+
/* @__PURE__ */ jsx(Badge, { color: DEAL_STAGE_COLORS[deal.cached_stage || ""] || "gray", children: formatDealStageLabel(deal.cached_stage) })
|
|
4344
|
+
] }),
|
|
4345
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4346
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Sent:" }),
|
|
4347
|
+
/* @__PURE__ */ jsx(Text, { children: deal.proposal_sent_at ? new Date(deal.proposal_sent_at).toLocaleString() : "N/A" })
|
|
4348
|
+
] }),
|
|
4349
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4350
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Envelope ID:" }),
|
|
4351
|
+
/* @__PURE__ */ jsx(Text, { children: deal.signature_envelope_id || "N/A" })
|
|
4352
|
+
] })
|
|
4353
|
+
] }) }),
|
|
4354
|
+
/* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
4355
|
+
/* @__PURE__ */ jsx(Title, { order: 4, children: "Contact" }),
|
|
4356
|
+
/* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 1, sm: 2 }, spacing: "sm", children: [
|
|
4357
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4358
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Name:" }),
|
|
4359
|
+
/* @__PURE__ */ jsx(Text, { children: contactName || "N/A" })
|
|
4360
|
+
] }),
|
|
4361
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4362
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Email:" }),
|
|
4363
|
+
/* @__PURE__ */ jsx(Text, { children: deal.contact?.email || deal.contact_email || "N/A" })
|
|
4364
|
+
] }),
|
|
4365
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4366
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Title:" }),
|
|
4367
|
+
/* @__PURE__ */ jsx(Text, { children: deal.contact?.title || "N/A" })
|
|
4368
|
+
] }),
|
|
4369
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4370
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Pipeline Status:" }),
|
|
4371
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: deal.contact?.pipeline_status ? Object.entries(deal.contact.pipeline_status).map(([key, val]) => {
|
|
4372
|
+
const status = val?.status;
|
|
4373
|
+
return status ? `${key}: ${status}` : null;
|
|
4374
|
+
}).filter(Boolean).join(", ") || "N/A" : "N/A" })
|
|
4375
|
+
] }),
|
|
4376
|
+
deal.contact?.headline && /* @__PURE__ */ jsxs(Group, { children: [
|
|
4377
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Headline:" }),
|
|
4378
|
+
/* @__PURE__ */ jsx(Text, { children: deal.contact.headline })
|
|
4379
|
+
] }),
|
|
4380
|
+
deal.contact?.linkedin_url && /* @__PURE__ */ jsxs(Group, { children: [
|
|
4381
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "LinkedIn:" }),
|
|
4382
|
+
/* @__PURE__ */ jsx(Text, { component: "a", href: deal.contact.linkedin_url, target: "_blank", c: "blue", children: "View Profile" })
|
|
4383
|
+
] })
|
|
4384
|
+
] })
|
|
4385
|
+
] }) }),
|
|
4386
|
+
/* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
4387
|
+
/* @__PURE__ */ jsx(Title, { order: 4, children: "Company" }),
|
|
4388
|
+
/* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 1, sm: 2 }, spacing: "sm", children: [
|
|
4389
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4390
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Name:" }),
|
|
4391
|
+
/* @__PURE__ */ jsx(Text, { children: deal.contact?.company?.name || "N/A" })
|
|
4392
|
+
] }),
|
|
4393
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4394
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Domain:" }),
|
|
4395
|
+
/* @__PURE__ */ jsx(Text, { children: deal.contact?.company?.domain || "N/A" })
|
|
4396
|
+
] }),
|
|
4397
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4398
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Segment:" }),
|
|
4399
|
+
/* @__PURE__ */ jsx(Text, { children: deal.contact?.company?.segment || "N/A" })
|
|
4400
|
+
] }),
|
|
4401
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4402
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Category:" }),
|
|
4403
|
+
/* @__PURE__ */ jsx(Text, { children: deal.contact?.company?.category || "N/A" })
|
|
4404
|
+
] }),
|
|
4405
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4406
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Employees:" }),
|
|
4407
|
+
/* @__PURE__ */ jsx(Text, { children: deal.contact?.company?.num_employees || "N/A" })
|
|
4408
|
+
] }),
|
|
4409
|
+
deal.contact?.company?.website && /* @__PURE__ */ jsxs(Group, { children: [
|
|
4410
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Website:" }),
|
|
4411
|
+
/* @__PURE__ */ jsx(Text, { component: "a", href: deal.contact.company.website, target: "_blank", c: "blue", children: deal.contact.company.website })
|
|
4412
|
+
] })
|
|
4413
|
+
] })
|
|
4414
|
+
] }) }),
|
|
4415
|
+
["proposal_signed", "payment_sent", "closed_won"].includes(deal.cached_stage || "") && /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
4416
|
+
/* @__PURE__ */ jsx(Title, { order: 4, children: "Payment" }),
|
|
4417
|
+
/* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 1, sm: 2 }, spacing: "sm", children: [
|
|
4418
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4419
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Initial Fee:" }),
|
|
4420
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
4421
|
+
"$",
|
|
4422
|
+
deal.initial_fee?.toLocaleString() || "Not set"
|
|
4423
|
+
] })
|
|
4424
|
+
] }),
|
|
4425
|
+
/* @__PURE__ */ jsxs(Group, { children: [
|
|
4426
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Monthly Fee:" }),
|
|
4427
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
4428
|
+
"$",
|
|
4429
|
+
deal.monthly_fee?.toLocaleString() || "Not set",
|
|
4430
|
+
"/mo"
|
|
4431
|
+
] })
|
|
4432
|
+
] })
|
|
4433
|
+
] }),
|
|
4434
|
+
deal.stripe_payment_link && /* @__PURE__ */ jsxs(Group, { children: [
|
|
4435
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: "Payment Link:" }),
|
|
4436
|
+
/* @__PURE__ */ jsx(Text, { component: "a", href: deal.stripe_payment_link, target: "_blank", c: "blue", children: deal.stripe_payment_link })
|
|
4437
|
+
] })
|
|
4438
|
+
] }) })
|
|
4439
|
+
] }) }),
|
|
4440
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { value: "discovery", pt: "md", children: /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsx(Code, { block: true, children: JSON.stringify(deal.discovery_data, null, 2) }) }) }),
|
|
4441
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { value: "activity", pt: "md", children: /* @__PURE__ */ jsx(ActivityTimeline, { activities: activityLog }) })
|
|
4442
|
+
] }) }),
|
|
4443
|
+
/* @__PURE__ */ jsx(CustomModal, { opened: deleteModalOpen, onClose: () => setDeleteModalOpen(false), size: "sm", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
4444
|
+
/* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "flex-start", children: [
|
|
4445
|
+
/* @__PURE__ */ jsx(Title, { order: 4, children: "Delete deal" }),
|
|
4446
|
+
/* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", onClick: () => setDeleteModalOpen(false), children: /* @__PURE__ */ jsx(IconX, { size: 18 }) })
|
|
4447
|
+
] }),
|
|
4448
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
4449
|
+
"Are you sure you want to delete the deal for ",
|
|
4450
|
+
/* @__PURE__ */ jsx("strong", { children: contactName || deal.contact_email }),
|
|
4451
|
+
"? This will cancel any active schedules and pending tasks for this contact."
|
|
4452
|
+
] }),
|
|
4453
|
+
(deal.signature_envelope_id || deal.stripe_payment_link) && /* @__PURE__ */ jsxs(Alert, { color: "yellow", variant: "light", children: [
|
|
4454
|
+
"This deal has ",
|
|
4455
|
+
deal.signature_envelope_id ? "a signed contract" : "",
|
|
4456
|
+
deal.signature_envelope_id && deal.stripe_payment_link ? " and " : "",
|
|
4457
|
+
deal.stripe_payment_link ? "an active payment link" : "",
|
|
4458
|
+
" that will not be automatically cleaned up."
|
|
4459
|
+
] }),
|
|
4460
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
4461
|
+
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", children: [
|
|
4462
|
+
/* @__PURE__ */ jsx(Button, { variant: "default", onClick: () => setDeleteModalOpen(false), disabled: deleteDeal.isPending, children: "Cancel" }),
|
|
4463
|
+
/* @__PURE__ */ jsx(
|
|
4464
|
+
Button,
|
|
4465
|
+
{
|
|
4466
|
+
color: "red",
|
|
4467
|
+
loading: deleteDeal.isPending,
|
|
4468
|
+
onClick: () => deleteDeal.mutate(deal.id, {
|
|
4469
|
+
onSuccess: () => {
|
|
4470
|
+
setDeleteModalOpen(false);
|
|
4471
|
+
void navigate({ to: "/crm/deals" });
|
|
4472
|
+
}
|
|
4473
|
+
}),
|
|
4474
|
+
children: "Delete deal"
|
|
4475
|
+
}
|
|
4476
|
+
)
|
|
4477
|
+
] })
|
|
4478
|
+
] }) })
|
|
4479
|
+
] }) });
|
|
4480
|
+
}
|
|
4075
4481
|
var LeadGenSidebarTop = () => {
|
|
4076
4482
|
return /* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconTarget, label: "Lead Gen" });
|
|
4077
4483
|
};
|
|
@@ -4089,33 +4495,1536 @@ var LeadGenSidebarMiddle = () => {
|
|
|
4089
4495
|
return /* @__PURE__ */ jsx(
|
|
4090
4496
|
SubshellNavItem,
|
|
4091
4497
|
{
|
|
4092
|
-
icon: item.icon,
|
|
4093
|
-
label: item.label,
|
|
4094
|
-
isActive,
|
|
4095
|
-
onClick: () => navigate(item.to)
|
|
4096
|
-
},
|
|
4097
|
-
item.to
|
|
4098
|
-
);
|
|
4099
|
-
}) }) });
|
|
4100
|
-
};
|
|
4101
|
-
var LeadGenSidebar = () => {
|
|
4102
|
-
return /* @__PURE__ */ jsxs(Stack, { gap: 0, style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
4103
|
-
/* @__PURE__ */ jsx(LeadGenSidebarTop, {}),
|
|
4104
|
-
/* @__PURE__ */ jsx(LeadGenSidebarMiddle, {})
|
|
4105
|
-
] });
|
|
4106
|
-
};
|
|
4107
|
-
var leadGenManifest = {
|
|
4108
|
-
key: "lead-gen",
|
|
4109
|
-
label: "Lead Gen",
|
|
4110
|
-
sidebar: LeadGenSidebar,
|
|
4111
|
-
subshellRoutes: ["/lead-gen"],
|
|
4112
|
-
navEntry: {
|
|
4113
|
-
label: "Lead Gen",
|
|
4114
|
-
icon: IconTarget,
|
|
4115
|
-
link: "/lead-gen",
|
|
4116
|
-
featureKey: "acquisition"
|
|
4498
|
+
icon: item.icon,
|
|
4499
|
+
label: item.label,
|
|
4500
|
+
isActive,
|
|
4501
|
+
onClick: () => navigate(item.to)
|
|
4502
|
+
},
|
|
4503
|
+
item.to
|
|
4504
|
+
);
|
|
4505
|
+
}) }) });
|
|
4506
|
+
};
|
|
4507
|
+
var LeadGenSidebar = () => {
|
|
4508
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: 0, style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
4509
|
+
/* @__PURE__ */ jsx(LeadGenSidebarTop, {}),
|
|
4510
|
+
/* @__PURE__ */ jsx(LeadGenSidebarMiddle, {})
|
|
4511
|
+
] });
|
|
4512
|
+
};
|
|
4513
|
+
var leadGenManifest = {
|
|
4514
|
+
key: "lead-gen",
|
|
4515
|
+
label: "Lead Gen",
|
|
4516
|
+
sidebar: LeadGenSidebar,
|
|
4517
|
+
subshellRoutes: ["/lead-gen"],
|
|
4518
|
+
navEntry: {
|
|
4519
|
+
label: "Lead Gen",
|
|
4520
|
+
icon: IconTarget,
|
|
4521
|
+
link: "/lead-gen",
|
|
4522
|
+
featureKey: "acquisition"
|
|
4523
|
+
}
|
|
4524
|
+
};
|
|
4525
|
+
var LEAD_GEN_ROUTE_LINKS = [
|
|
4526
|
+
{ label: "Overview", to: "/lead-gen" },
|
|
4527
|
+
{ label: "Lists", to: "/lead-gen/lists" },
|
|
4528
|
+
{ label: "Companies", to: "/lead-gen/companies" },
|
|
4529
|
+
{ label: "Contacts", to: "/lead-gen/contacts" },
|
|
4530
|
+
{ label: "Deliverability", to: "/lead-gen/deliverability" }
|
|
4531
|
+
];
|
|
4532
|
+
function LeadGenRouteShell({
|
|
4533
|
+
title,
|
|
4534
|
+
caption,
|
|
4535
|
+
body,
|
|
4536
|
+
links = LEAD_GEN_ROUTE_LINKS
|
|
4537
|
+
}) {
|
|
4538
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
4539
|
+
/* @__PURE__ */ jsx(PageTitleCaption, { title, caption }),
|
|
4540
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, p: "lg", children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
4541
|
+
body,
|
|
4542
|
+
/* @__PURE__ */ jsx(Text, { children: links.map((link, index) => /* @__PURE__ */ jsxs("span", { children: [
|
|
4543
|
+
index > 0 ? " | " : null,
|
|
4544
|
+
/* @__PURE__ */ jsx(Anchor, { component: Link$1, to: link.to, children: link.label })
|
|
4545
|
+
] }, link.to)) })
|
|
4546
|
+
] }) })
|
|
4547
|
+
] }) }) });
|
|
4548
|
+
}
|
|
4549
|
+
function formatDate2(dateValue) {
|
|
4550
|
+
const date = typeof dateValue === "string" ? new Date(dateValue) : dateValue;
|
|
4551
|
+
return date.toLocaleDateString("en-US", {
|
|
4552
|
+
month: "short",
|
|
4553
|
+
day: "numeric",
|
|
4554
|
+
year: "numeric"
|
|
4555
|
+
});
|
|
4556
|
+
}
|
|
4557
|
+
function getStatusColor3(status) {
|
|
4558
|
+
return status === "active" ? "green" : status === "invalid" ? "red" : "gray";
|
|
4559
|
+
}
|
|
4560
|
+
function getEnrichmentColor(status) {
|
|
4561
|
+
switch (status) {
|
|
4562
|
+
case "complete":
|
|
4563
|
+
return "green";
|
|
4564
|
+
case "pending":
|
|
4565
|
+
return "yellow";
|
|
4566
|
+
case "failed":
|
|
4567
|
+
return "red";
|
|
4568
|
+
default:
|
|
4569
|
+
return "gray";
|
|
4570
|
+
}
|
|
4571
|
+
}
|
|
4572
|
+
function getEnrichmentStatus(enrichmentData) {
|
|
4573
|
+
if (!enrichmentData || typeof enrichmentData !== "object") return "pending";
|
|
4574
|
+
const website = enrichmentData.website;
|
|
4575
|
+
const linkedin = enrichmentData.linkedin;
|
|
4576
|
+
if (website === "complete" && linkedin === "complete") return "complete";
|
|
4577
|
+
if (website === "failed" || linkedin === "failed") return "failed";
|
|
4578
|
+
return "pending";
|
|
4579
|
+
}
|
|
4580
|
+
function formatName(parts, fallback) {
|
|
4581
|
+
const name = parts.filter(Boolean).join(" ").trim();
|
|
4582
|
+
return name || fallback;
|
|
4583
|
+
}
|
|
4584
|
+
function CompanyDetailModal({ company, onClose }) {
|
|
4585
|
+
return /* @__PURE__ */ jsx(CustomModal, { opened: !!company, onClose, size: "xl", children: company ? /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
4586
|
+
/* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "flex-start", children: [
|
|
4587
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4588
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: company.name }),
|
|
4589
|
+
company.domain ? /* @__PURE__ */ jsxs(Anchor, { href: `https://${company.domain}`, target: "_blank", size: "sm", c: "dimmed", children: [
|
|
4590
|
+
company.domain,
|
|
4591
|
+
" ",
|
|
4592
|
+
/* @__PURE__ */ jsx(IconExternalLink, { size: 12, style: { verticalAlign: "middle" } })
|
|
4593
|
+
] }) : null
|
|
4594
|
+
] }),
|
|
4595
|
+
/* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", onClick: onClose, children: /* @__PURE__ */ jsx(IconX, { size: 18 }) })
|
|
4596
|
+
] }),
|
|
4597
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
4598
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
4599
|
+
/* @__PURE__ */ jsx(Title, { order: 4, mb: "xs", children: "Firmographics" }),
|
|
4600
|
+
/* @__PURE__ */ jsxs(SimpleGrid, { cols: 3, children: [
|
|
4601
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4602
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Segment" }),
|
|
4603
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: company.segment || "-" })
|
|
4604
|
+
] }),
|
|
4605
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4606
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Category" }),
|
|
4607
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: company.category || "-" })
|
|
4608
|
+
] }),
|
|
4609
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4610
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Employees" }),
|
|
4611
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: company.numEmployees || "-" })
|
|
4612
|
+
] }),
|
|
4613
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4614
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Founded" }),
|
|
4615
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: company.foundedYear || "-" })
|
|
4616
|
+
] }),
|
|
4617
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4618
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Location" }),
|
|
4619
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: [company.locationCity, company.locationState].filter(Boolean).join(", ") || "-" })
|
|
4620
|
+
] }),
|
|
4621
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4622
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Contacts" }),
|
|
4623
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: company.contactCount })
|
|
4624
|
+
] })
|
|
4625
|
+
] })
|
|
4626
|
+
] }),
|
|
4627
|
+
company.enrichmentData ? /* @__PURE__ */ jsxs(Box, { children: [
|
|
4628
|
+
/* @__PURE__ */ jsx(Title, { order: 4, mb: "xs", children: "Enrichment Data" }),
|
|
4629
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", style: { whiteSpace: "pre-wrap" }, children: JSON.stringify(company.enrichmentData, null, 2) })
|
|
4630
|
+
] }) : null,
|
|
4631
|
+
/* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
4632
|
+
company.linkedinUrl ? /* @__PURE__ */ jsxs(Anchor, { href: company.linkedinUrl, target: "_blank", size: "sm", children: [
|
|
4633
|
+
"LinkedIn ",
|
|
4634
|
+
/* @__PURE__ */ jsx(IconExternalLink, { size: 12 })
|
|
4635
|
+
] }) : null,
|
|
4636
|
+
company.website ? /* @__PURE__ */ jsxs(Anchor, { href: company.website, target: "_blank", size: "sm", children: [
|
|
4637
|
+
"Website ",
|
|
4638
|
+
/* @__PURE__ */ jsx(IconExternalLink, { size: 12 })
|
|
4639
|
+
] }) : null
|
|
4640
|
+
] }),
|
|
4641
|
+
/* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
|
|
4642
|
+
"Created: ",
|
|
4643
|
+
formatDate2(company.createdAt),
|
|
4644
|
+
company.updatedAt && ` | Updated: ${formatDate2(company.updatedAt)}`
|
|
4645
|
+
] })
|
|
4646
|
+
] }) : null });
|
|
4647
|
+
}
|
|
4648
|
+
function ContactDetailModal({ contact, onClose }) {
|
|
4649
|
+
return /* @__PURE__ */ jsx(CustomModal, { opened: !!contact, onClose, size: "xl", children: contact ? /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
4650
|
+
/* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "flex-start", children: [
|
|
4651
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4652
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: formatName([contact.firstName, contact.lastName], contact.email) }),
|
|
4653
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: contact.email }),
|
|
4654
|
+
contact.title ? /* @__PURE__ */ jsx(Text, { size: "sm", children: contact.title }) : null
|
|
4655
|
+
] }),
|
|
4656
|
+
/* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", onClick: onClose, children: /* @__PURE__ */ jsx(IconX, { size: 18 }) })
|
|
4657
|
+
] }),
|
|
4658
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
4659
|
+
/* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
4660
|
+
/* @__PURE__ */ jsx(Badge, { color: getStatusColor3(contact.status), children: contact.status }),
|
|
4661
|
+
contact.openingLine ? /* @__PURE__ */ jsx(Badge, { color: "green", children: "Personalized" }) : null
|
|
4662
|
+
] }),
|
|
4663
|
+
contact.company ? /* @__PURE__ */ jsxs(Box, { children: [
|
|
4664
|
+
/* @__PURE__ */ jsx(Title, { order: 4, mb: "xs", children: "Company" }),
|
|
4665
|
+
/* @__PURE__ */ jsxs(Card, { withBorder: true, children: [
|
|
4666
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: contact.company.name }),
|
|
4667
|
+
contact.company.domain ? /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: contact.company.domain }) : null
|
|
4668
|
+
] })
|
|
4669
|
+
] }) : null,
|
|
4670
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
4671
|
+
/* @__PURE__ */ jsx(Title, { order: 4, mb: "xs", children: "Contact Information" }),
|
|
4672
|
+
/* @__PURE__ */ jsxs(SimpleGrid, { cols: 2, children: [
|
|
4673
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4674
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Headline" }),
|
|
4675
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: contact.headline || "-" })
|
|
4676
|
+
] }),
|
|
4677
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4678
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "LinkedIn" }),
|
|
4679
|
+
contact.linkedinUrl ? /* @__PURE__ */ jsxs(Anchor, { href: contact.linkedinUrl, target: "_blank", size: "sm", children: [
|
|
4680
|
+
"View Profile ",
|
|
4681
|
+
/* @__PURE__ */ jsx(IconExternalLink, { size: 12 })
|
|
4682
|
+
] }) : /* @__PURE__ */ jsx(Text, { size: "sm", children: "-" })
|
|
4683
|
+
] })
|
|
4684
|
+
] })
|
|
4685
|
+
] }),
|
|
4686
|
+
contact.filterReason ? /* @__PURE__ */ jsxs(Box, { children: [
|
|
4687
|
+
/* @__PURE__ */ jsx(Title, { order: 4, mb: "xs", children: "Qualification" }),
|
|
4688
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "red", children: contact.filterReason })
|
|
4689
|
+
] }) : null,
|
|
4690
|
+
contact.openingLine ? /* @__PURE__ */ jsxs(Box, { children: [
|
|
4691
|
+
/* @__PURE__ */ jsx(Title, { order: 4, mb: "xs", children: "Personalization" }),
|
|
4692
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", children: contact.openingLine })
|
|
4693
|
+
] }) : null,
|
|
4694
|
+
/* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
|
|
4695
|
+
"Created: ",
|
|
4696
|
+
formatDate2(contact.createdAt),
|
|
4697
|
+
contact.updatedAt && ` | Updated: ${formatDate2(contact.updatedAt)}`
|
|
4698
|
+
] })
|
|
4699
|
+
] }) : null });
|
|
4700
|
+
}
|
|
4701
|
+
var LIST_TEMPLATE_OPTIONS = [
|
|
4702
|
+
{
|
|
4703
|
+
value: "blank",
|
|
4704
|
+
label: "Blank",
|
|
4705
|
+
description: "Create an empty draft list with qualification defaults and no pipeline steps."
|
|
4706
|
+
},
|
|
4707
|
+
{
|
|
4708
|
+
value: "full_pipeline",
|
|
4709
|
+
label: "Full 6-Stage",
|
|
4710
|
+
description: "Create a complete lead-gen pipeline from scrape through personalization."
|
|
4711
|
+
},
|
|
4712
|
+
{
|
|
4713
|
+
value: "personalize_only",
|
|
4714
|
+
label: "Personalize Only",
|
|
4715
|
+
description: "Start with personalization and upload-focused steps for already-prepared contacts."
|
|
4716
|
+
},
|
|
4717
|
+
{
|
|
4718
|
+
value: "email_refresh",
|
|
4719
|
+
label: "Email Refresh",
|
|
4720
|
+
description: "Run discovery, verification, and personalization for an existing company set."
|
|
4721
|
+
}
|
|
4722
|
+
];
|
|
4723
|
+
function buildListConfig(template, targetDescription) {
|
|
4724
|
+
const qualification = {
|
|
4725
|
+
targetDescription,
|
|
4726
|
+
minReviewCount: 5,
|
|
4727
|
+
minRating: 4,
|
|
4728
|
+
excludeFranchises: true,
|
|
4729
|
+
customRules: ""
|
|
4730
|
+
};
|
|
4731
|
+
const personalization = {
|
|
4732
|
+
industryContext: targetDescription,
|
|
4733
|
+
emailBody: "",
|
|
4734
|
+
creativeDirection: "",
|
|
4735
|
+
exclusionRules: []
|
|
4736
|
+
};
|
|
4737
|
+
switch (template) {
|
|
4738
|
+
case "full_pipeline":
|
|
4739
|
+
return {
|
|
4740
|
+
qualification,
|
|
4741
|
+
enrichment: {
|
|
4742
|
+
emailDiscovery: { primary: "tomba" },
|
|
4743
|
+
emailVerification: { provider: "millionverifier", threshold: "ok" }
|
|
4744
|
+
},
|
|
4745
|
+
personalization,
|
|
4746
|
+
pipeline: {
|
|
4747
|
+
steps: [
|
|
4748
|
+
{
|
|
4749
|
+
key: "scrape",
|
|
4750
|
+
label: "Scrape Companies",
|
|
4751
|
+
resourceId: "lgn-01a-google-maps-scrape-workflow",
|
|
4752
|
+
inputTemplate: {},
|
|
4753
|
+
enabled: true,
|
|
4754
|
+
order: 1
|
|
4755
|
+
},
|
|
4756
|
+
{
|
|
4757
|
+
key: "acquire",
|
|
4758
|
+
label: "Import Companies",
|
|
4759
|
+
resourceId: "lgn-01b-apify-acquire-workflow",
|
|
4760
|
+
inputTemplate: {},
|
|
4761
|
+
enabled: true,
|
|
4762
|
+
order: 2
|
|
4763
|
+
},
|
|
4764
|
+
{
|
|
4765
|
+
key: "extract",
|
|
4766
|
+
label: "Extract Website Data",
|
|
4767
|
+
resourceId: "lgn-02-website-extract-workflow",
|
|
4768
|
+
inputTemplate: {},
|
|
4769
|
+
enabled: true,
|
|
4770
|
+
order: 3
|
|
4771
|
+
},
|
|
4772
|
+
{
|
|
4773
|
+
key: "qualify",
|
|
4774
|
+
label: "Qualify Companies",
|
|
4775
|
+
resourceId: "lgn-03-company-qualification-workflow",
|
|
4776
|
+
inputTemplate: {},
|
|
4777
|
+
enabled: true,
|
|
4778
|
+
order: 4
|
|
4779
|
+
},
|
|
4780
|
+
{
|
|
4781
|
+
key: "discover",
|
|
4782
|
+
label: "Discover Emails",
|
|
4783
|
+
resourceId: "lgn-04-email-discovery-workflow",
|
|
4784
|
+
inputTemplate: {},
|
|
4785
|
+
enabled: true,
|
|
4786
|
+
order: 5
|
|
4787
|
+
},
|
|
4788
|
+
{
|
|
4789
|
+
key: "verify",
|
|
4790
|
+
label: "Verify Emails",
|
|
4791
|
+
resourceId: "lgn-05-email-verification-workflow",
|
|
4792
|
+
inputTemplate: {},
|
|
4793
|
+
enabled: true,
|
|
4794
|
+
order: 6
|
|
4795
|
+
},
|
|
4796
|
+
{
|
|
4797
|
+
key: "personalize",
|
|
4798
|
+
label: "Personalize Outreach",
|
|
4799
|
+
resourceId: "ist-personalization-workflow",
|
|
4800
|
+
inputTemplate: {},
|
|
4801
|
+
enabled: true,
|
|
4802
|
+
order: 7
|
|
4803
|
+
}
|
|
4804
|
+
]
|
|
4805
|
+
}
|
|
4806
|
+
};
|
|
4807
|
+
case "personalize_only":
|
|
4808
|
+
return {
|
|
4809
|
+
qualification,
|
|
4810
|
+
personalization,
|
|
4811
|
+
pipeline: {
|
|
4812
|
+
steps: [
|
|
4813
|
+
{
|
|
4814
|
+
key: "personalize",
|
|
4815
|
+
label: "Personalize Outreach",
|
|
4816
|
+
resourceId: "ist-personalization-workflow",
|
|
4817
|
+
inputTemplate: {},
|
|
4818
|
+
enabled: true,
|
|
4819
|
+
order: 1
|
|
4820
|
+
},
|
|
4821
|
+
{
|
|
4822
|
+
key: "upload",
|
|
4823
|
+
label: "Upload Contacts",
|
|
4824
|
+
resourceId: "ist-upload-contacts-workflow",
|
|
4825
|
+
inputTemplate: { requireOpeningLine: true },
|
|
4826
|
+
enabled: true,
|
|
4827
|
+
order: 2
|
|
4828
|
+
}
|
|
4829
|
+
]
|
|
4830
|
+
}
|
|
4831
|
+
};
|
|
4832
|
+
case "email_refresh":
|
|
4833
|
+
return {
|
|
4834
|
+
qualification,
|
|
4835
|
+
enrichment: {
|
|
4836
|
+
emailDiscovery: { primary: "tomba" },
|
|
4837
|
+
emailVerification: { provider: "millionverifier", threshold: "ok" }
|
|
4838
|
+
},
|
|
4839
|
+
personalization,
|
|
4840
|
+
pipeline: {
|
|
4841
|
+
steps: [
|
|
4842
|
+
{
|
|
4843
|
+
key: "discover",
|
|
4844
|
+
label: "Discover Emails",
|
|
4845
|
+
resourceId: "lgn-04-email-discovery-workflow",
|
|
4846
|
+
inputTemplate: {},
|
|
4847
|
+
enabled: true,
|
|
4848
|
+
order: 1
|
|
4849
|
+
},
|
|
4850
|
+
{
|
|
4851
|
+
key: "verify",
|
|
4852
|
+
label: "Verify Emails",
|
|
4853
|
+
resourceId: "lgn-05-email-verification-workflow",
|
|
4854
|
+
inputTemplate: {},
|
|
4855
|
+
enabled: true,
|
|
4856
|
+
order: 2
|
|
4857
|
+
},
|
|
4858
|
+
{
|
|
4859
|
+
key: "personalize",
|
|
4860
|
+
label: "Personalize Outreach",
|
|
4861
|
+
resourceId: "ist-personalization-workflow",
|
|
4862
|
+
inputTemplate: {},
|
|
4863
|
+
enabled: true,
|
|
4864
|
+
order: 3
|
|
4865
|
+
}
|
|
4866
|
+
]
|
|
4867
|
+
}
|
|
4868
|
+
};
|
|
4869
|
+
case "blank":
|
|
4870
|
+
default:
|
|
4871
|
+
return {
|
|
4872
|
+
qualification,
|
|
4873
|
+
pipeline: {
|
|
4874
|
+
steps: []
|
|
4875
|
+
}
|
|
4876
|
+
};
|
|
4877
|
+
}
|
|
4878
|
+
}
|
|
4879
|
+
function useDeleteLists() {
|
|
4880
|
+
const { apiRequest, organizationId } = useElevasisServices();
|
|
4881
|
+
const queryClient = useQueryClient();
|
|
4882
|
+
return useMutation({
|
|
4883
|
+
mutationFn: async (listIds) => {
|
|
4884
|
+
const uniqueIds = [...new Set(listIds)].filter(Boolean);
|
|
4885
|
+
if (uniqueIds.length === 0) return;
|
|
4886
|
+
await Promise.all(
|
|
4887
|
+
uniqueIds.map(
|
|
4888
|
+
(listId) => apiRequest(`/acquisition/lists/${listId}`, {
|
|
4889
|
+
method: "DELETE"
|
|
4890
|
+
})
|
|
4891
|
+
)
|
|
4892
|
+
);
|
|
4893
|
+
},
|
|
4894
|
+
onSuccess: () => {
|
|
4895
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.list(organizationId) });
|
|
4896
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.telemetry(organizationId) });
|
|
4897
|
+
showSuccessNotification("Lists deleted");
|
|
4898
|
+
},
|
|
4899
|
+
onError: (error) => {
|
|
4900
|
+
showApiErrorNotification(error);
|
|
4901
|
+
}
|
|
4902
|
+
});
|
|
4903
|
+
}
|
|
4904
|
+
var EM_DASH = "\u2014";
|
|
4905
|
+
function computeCompletionPercentage(populated, personalized) {
|
|
4906
|
+
if (populated === 0) return EM_DASH;
|
|
4907
|
+
return `${Math.round(personalized / populated * 100)}%`;
|
|
4908
|
+
}
|
|
4909
|
+
function LeadGenOverviewPage() {
|
|
4910
|
+
const { data, isLoading, isError, error } = useListsTelemetry();
|
|
4911
|
+
const totalCompanies = data?.reduce((sum, list) => sum + list.totalCompanies, 0) ?? 0;
|
|
4912
|
+
const totalContacts = data?.reduce((sum, list) => sum + list.totalContacts, 0) ?? 0;
|
|
4913
|
+
const stageTotals = data?.reduce(
|
|
4914
|
+
(acc, list) => ({
|
|
4915
|
+
populated: acc.populated + list.stageCounts.populated,
|
|
4916
|
+
extracted: acc.extracted + list.stageCounts.extracted,
|
|
4917
|
+
qualified: acc.qualified + list.stageCounts.qualified,
|
|
4918
|
+
discovered: acc.discovered + list.stageCounts.discovered,
|
|
4919
|
+
verified: acc.verified + list.stageCounts.verified,
|
|
4920
|
+
personalized: acc.personalized + list.stageCounts.personalized,
|
|
4921
|
+
uploaded: acc.uploaded + list.stageCounts.uploaded
|
|
4922
|
+
}),
|
|
4923
|
+
{ populated: 0, extracted: 0, qualified: 0, discovered: 0, verified: 0, personalized: 0, uploaded: 0 }
|
|
4924
|
+
) ?? { populated: 0, extracted: 0, qualified: 0, discovered: 0, verified: 0, personalized: 0, uploaded: 0 };
|
|
4925
|
+
const completionLabel = (() => {
|
|
4926
|
+
if (!data?.length) return EM_DASH;
|
|
4927
|
+
return computeCompletionPercentage(stageTotals.populated, stageTotals.personalized);
|
|
4928
|
+
})();
|
|
4929
|
+
const stageTiles = [
|
|
4930
|
+
{ label: "Populated", value: stageTotals.populated },
|
|
4931
|
+
{ label: "Extracted", value: stageTotals.extracted },
|
|
4932
|
+
{ label: "Qualified", value: stageTotals.qualified },
|
|
4933
|
+
{ label: "Discovered", value: stageTotals.discovered },
|
|
4934
|
+
{ label: "Verified", value: stageTotals.verified },
|
|
4935
|
+
{ label: "Personalized", value: stageTotals.personalized },
|
|
4936
|
+
{ label: "Uploaded", value: stageTotals.uploaded }
|
|
4937
|
+
];
|
|
4938
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
4939
|
+
/* @__PURE__ */ jsx(
|
|
4940
|
+
PageTitleCaption,
|
|
4941
|
+
{
|
|
4942
|
+
title: "Lead Gen Overview",
|
|
4943
|
+
caption: "Pipeline health, list roll-up, and active work at a glance"
|
|
4944
|
+
}
|
|
4945
|
+
),
|
|
4946
|
+
isLoading ? /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) }) : isError ? /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(CenteredErrorState, { error, title: "Failed to load list telemetry" }) }) : !data?.length ? /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { h: 300, children: /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconAlertCircle, { size: 16 }), color: "gray", variant: "light", children: "No lists yet." }) }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4947
|
+
/* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 2, sm: 4 }, children: [
|
|
4948
|
+
/* @__PURE__ */ jsx(StatCard, { variant: "hero", icon: IconChartBar, value: data.length, label: "Total Lists" }),
|
|
4949
|
+
/* @__PURE__ */ jsx(StatCard, { variant: "hero", icon: IconBuildingFactory2, value: totalCompanies, label: "Total Companies" }),
|
|
4950
|
+
/* @__PURE__ */ jsx(StatCard, { variant: "hero", icon: IconUsers, value: totalContacts, label: "Total Contacts" }),
|
|
4951
|
+
/* @__PURE__ */ jsx(StatCard, { variant: "hero", icon: IconChecklist, value: completionLabel, label: "Overall Completion" })
|
|
4952
|
+
] }),
|
|
4953
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
|
|
4954
|
+
"View per-list detail on the",
|
|
4955
|
+
" ",
|
|
4956
|
+
/* @__PURE__ */ jsx(Anchor, { component: Link$1, to: "/lead-gen/lists", size: "sm", children: "Lists" }),
|
|
4957
|
+
" ",
|
|
4958
|
+
"page."
|
|
4959
|
+
] }),
|
|
4960
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
4961
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: "Pipeline Roll-Up" }),
|
|
4962
|
+
/* @__PURE__ */ jsx(SimpleGrid, { cols: { base: 2, sm: 3, lg: 7 }, children: stageTiles.map((tile) => /* @__PURE__ */ jsxs(Paper, { withBorder: true, p: "sm", children: [
|
|
4963
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: tile.label }),
|
|
4964
|
+
/* @__PURE__ */ jsx(Title, { order: 4, children: tile.value })
|
|
4965
|
+
] }, tile.label)) })
|
|
4966
|
+
] }) }),
|
|
4967
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
4968
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: "List Snapshot" }),
|
|
4969
|
+
/* @__PURE__ */ jsxs(Table, { children: [
|
|
4970
|
+
/* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
4971
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "List" }),
|
|
4972
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Companies" }),
|
|
4973
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Contacts" }),
|
|
4974
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Completion" }),
|
|
4975
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Status" })
|
|
4976
|
+
] }) }),
|
|
4977
|
+
/* @__PURE__ */ jsx(Table.Tbody, { children: data.map((list) => {
|
|
4978
|
+
const completion = computeCompletionPercentage(
|
|
4979
|
+
list.stageCounts.populated,
|
|
4980
|
+
list.stageCounts.personalized
|
|
4981
|
+
);
|
|
4982
|
+
const isActive = (list.activeWorkflows?.length ?? 0) > 0;
|
|
4983
|
+
return /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
4984
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, children: list.listId }) }),
|
|
4985
|
+
/* @__PURE__ */ jsx(Table.Td, { children: list.totalCompanies }),
|
|
4986
|
+
/* @__PURE__ */ jsx(Table.Td, { children: list.totalContacts }),
|
|
4987
|
+
/* @__PURE__ */ jsx(Table.Td, { children: completion }),
|
|
4988
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { size: "sm", variant: isActive ? "light" : "outline", color: isActive ? "green" : "gray", children: isActive ? "Active Work" : "Idle" }) })
|
|
4989
|
+
] }, list.listId);
|
|
4990
|
+
}) })
|
|
4991
|
+
] })
|
|
4992
|
+
] }) })
|
|
4993
|
+
] })
|
|
4994
|
+
] }) }) });
|
|
4995
|
+
}
|
|
4996
|
+
function computeBounceRate(d) {
|
|
4997
|
+
const denominator = d.valid + d.risky + d.invalid + d.bounced;
|
|
4998
|
+
if (denominator === 0) return EM_DASH;
|
|
4999
|
+
return `${(d.bounced / denominator * 100).toFixed(1)}%`;
|
|
5000
|
+
}
|
|
5001
|
+
function LeadGenDeliverabilityPage() {
|
|
5002
|
+
const { data, isLoading, error } = useListsTelemetry();
|
|
5003
|
+
if (isLoading) {
|
|
5004
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
5005
|
+
/* @__PURE__ */ jsx(
|
|
5006
|
+
PageTitleCaption,
|
|
5007
|
+
{
|
|
5008
|
+
title: "Deliverability",
|
|
5009
|
+
caption: "Email validity breakdown and bounce health across lists"
|
|
5010
|
+
}
|
|
5011
|
+
),
|
|
5012
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) })
|
|
5013
|
+
] }) }) });
|
|
5014
|
+
}
|
|
5015
|
+
if (error) {
|
|
5016
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
5017
|
+
/* @__PURE__ */ jsx(
|
|
5018
|
+
PageTitleCaption,
|
|
5019
|
+
{
|
|
5020
|
+
title: "Deliverability",
|
|
5021
|
+
caption: "Email validity breakdown and bounce health across lists"
|
|
5022
|
+
}
|
|
5023
|
+
),
|
|
5024
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(CenteredErrorState, { error, title: "Failed to load deliverability data" }) })
|
|
5025
|
+
] }) }) });
|
|
5026
|
+
}
|
|
5027
|
+
if (data?.length === 0) {
|
|
5028
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
5029
|
+
/* @__PURE__ */ jsx(
|
|
5030
|
+
PageTitleCaption,
|
|
5031
|
+
{
|
|
5032
|
+
title: "Deliverability",
|
|
5033
|
+
caption: "Email validity breakdown and bounce health across lists"
|
|
5034
|
+
}
|
|
5035
|
+
),
|
|
5036
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { h: 300, children: /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconMailCheck, { size: 16 }), color: "gray", variant: "light", children: "No lists yet. Deliverability will populate once contacts are validated." }) }) })
|
|
5037
|
+
] }) }) });
|
|
5038
|
+
}
|
|
5039
|
+
const lists = data ?? [];
|
|
5040
|
+
const totals = lists.reduce(
|
|
5041
|
+
(acc, list) => ({
|
|
5042
|
+
valid: acc.valid + list.deliverability.valid,
|
|
5043
|
+
risky: acc.risky + list.deliverability.risky,
|
|
5044
|
+
invalid: acc.invalid + list.deliverability.invalid,
|
|
5045
|
+
unknown: acc.unknown + list.deliverability.unknown,
|
|
5046
|
+
bounced: acc.bounced + list.deliverability.bounced
|
|
5047
|
+
}),
|
|
5048
|
+
{ valid: 0, risky: 0, invalid: 0, unknown: 0, bounced: 0 }
|
|
5049
|
+
);
|
|
5050
|
+
const summaryTiles = [
|
|
5051
|
+
{ label: "Valid", value: totals.valid, icon: IconMailCheck },
|
|
5052
|
+
{ label: "Risky", value: totals.risky, icon: IconAlertCircle },
|
|
5053
|
+
{ label: "Invalid", value: totals.invalid, icon: IconX },
|
|
5054
|
+
{ label: "Unknown", value: totals.unknown, icon: IconQuestionMark },
|
|
5055
|
+
{ label: "Bounced", value: totals.bounced, icon: IconAlertCircle },
|
|
5056
|
+
{ label: "Bounce Rate", value: computeBounceRate(totals), icon: IconChecklist }
|
|
5057
|
+
];
|
|
5058
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
5059
|
+
/* @__PURE__ */ jsx(
|
|
5060
|
+
PageTitleCaption,
|
|
5061
|
+
{
|
|
5062
|
+
title: "Deliverability",
|
|
5063
|
+
caption: "Email validity breakdown and bounce health across lists"
|
|
5064
|
+
}
|
|
5065
|
+
),
|
|
5066
|
+
/* @__PURE__ */ jsx(SimpleGrid, { cols: { base: 2, sm: 3, lg: 6 }, children: summaryTiles.map((tile) => /* @__PURE__ */ jsx(StatCard, { variant: "hero", icon: tile.icon, value: tile.value, label: tile.label }, tile.label)) }),
|
|
5067
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsxs(Table, { children: [
|
|
5068
|
+
/* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
5069
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "List ID" }),
|
|
5070
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Valid" }),
|
|
5071
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Risky" }),
|
|
5072
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Invalid" }),
|
|
5073
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Unknown" }),
|
|
5074
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Bounced" }),
|
|
5075
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Bounce Rate" })
|
|
5076
|
+
] }) }),
|
|
5077
|
+
/* @__PURE__ */ jsx(Table.Tbody, { children: lists.map((list) => /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
5078
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, children: list.listId }) }),
|
|
5079
|
+
/* @__PURE__ */ jsx(Table.Td, { children: list.deliverability.valid }),
|
|
5080
|
+
/* @__PURE__ */ jsx(Table.Td, { children: list.deliverability.risky }),
|
|
5081
|
+
/* @__PURE__ */ jsx(Table.Td, { children: list.deliverability.invalid }),
|
|
5082
|
+
/* @__PURE__ */ jsx(Table.Td, { children: list.deliverability.unknown }),
|
|
5083
|
+
/* @__PURE__ */ jsx(Table.Td, { children: list.deliverability.bounced }),
|
|
5084
|
+
/* @__PURE__ */ jsx(Table.Td, { children: computeBounceRate(list.deliverability) })
|
|
5085
|
+
] }, list.listId)) })
|
|
5086
|
+
] }) })
|
|
5087
|
+
] }) }) });
|
|
5088
|
+
}
|
|
5089
|
+
var PAGE_SIZE_DEFAULT2 = 20;
|
|
5090
|
+
function LeadGenListsPage() {
|
|
5091
|
+
const navigate = useNavigate();
|
|
5092
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
5093
|
+
const [showCreateList, setShowCreateList] = useState(false);
|
|
5094
|
+
const [newListName, setNewListName] = useState("");
|
|
5095
|
+
const [newListDescription, setNewListDescription] = useState("");
|
|
5096
|
+
const [selectedTemplate, setSelectedTemplate] = useState("full_pipeline");
|
|
5097
|
+
const [showBatchDelete, setShowBatchDelete] = useState(false);
|
|
5098
|
+
const { data: lists, isLoading: listsLoading } = useLists();
|
|
5099
|
+
const { data: telemetry, isLoading: telemetryLoading } = useListsTelemetry();
|
|
5100
|
+
const createListMutation = useCreateList();
|
|
5101
|
+
const deleteListsMutation = useDeleteLists();
|
|
5102
|
+
const { sort, toggleSort } = useTableSort("created");
|
|
5103
|
+
const contactCountByListId = useMemo(
|
|
5104
|
+
() => new Map((telemetry ?? []).map((item) => [item.listId, item.totalContacts])),
|
|
5105
|
+
[telemetry]
|
|
5106
|
+
);
|
|
5107
|
+
const sortAccessors2 = useMemo(
|
|
5108
|
+
() => ({
|
|
5109
|
+
name: (list) => list.name,
|
|
5110
|
+
description: (list) => list.description || "",
|
|
5111
|
+
contacts: (list) => contactCountByListId.get(list.id) ?? 0,
|
|
5112
|
+
created: (list) => list.createdAt
|
|
5113
|
+
}),
|
|
5114
|
+
[contactCountByListId]
|
|
5115
|
+
);
|
|
5116
|
+
const filteredLists = useMemo(() => {
|
|
5117
|
+
if (!lists) return [];
|
|
5118
|
+
if (!searchQuery.trim()) return lists;
|
|
5119
|
+
const query = searchQuery.toLowerCase();
|
|
5120
|
+
return lists.filter((list) => list.name.toLowerCase().includes(query));
|
|
5121
|
+
}, [lists, searchQuery]);
|
|
5122
|
+
const sortedLists = useMemo(() => sortData(filteredLists, sort, sortAccessors2), [filteredLists, sort, sortAccessors2]);
|
|
5123
|
+
const pagination = usePaginationState(PAGE_SIZE_DEFAULT2, [searchQuery], sortedLists.length);
|
|
5124
|
+
const paginatedLists = useMemo(
|
|
5125
|
+
() => sortedLists.slice(pagination.offset, pagination.offset + PAGE_SIZE_DEFAULT2),
|
|
5126
|
+
[sortedLists, pagination.offset]
|
|
5127
|
+
);
|
|
5128
|
+
const selection = useTableSelection(paginatedLists, sortedLists);
|
|
5129
|
+
const selectedTemplateMeta = LIST_TEMPLATE_OPTIONS.find((option) => option.value === selectedTemplate);
|
|
5130
|
+
function resetCreateListModal() {
|
|
5131
|
+
setNewListName("");
|
|
5132
|
+
setNewListDescription("");
|
|
5133
|
+
setSelectedTemplate("full_pipeline");
|
|
5134
|
+
setShowCreateList(false);
|
|
5135
|
+
}
|
|
5136
|
+
function handleCreateList() {
|
|
5137
|
+
const trimmedName = newListName.trim();
|
|
5138
|
+
if (!trimmedName) return;
|
|
5139
|
+
const body = {
|
|
5140
|
+
name: trimmedName,
|
|
5141
|
+
description: newListDescription.trim() || null,
|
|
5142
|
+
type: selectedTemplate,
|
|
5143
|
+
config: buildListConfig(selectedTemplate, trimmedName)
|
|
5144
|
+
};
|
|
5145
|
+
createListMutation.mutate(body, {
|
|
5146
|
+
onSuccess: (list) => {
|
|
5147
|
+
resetCreateListModal();
|
|
5148
|
+
navigate({ to: "/lead-gen/lists/$listId", params: { listId: list.id } });
|
|
5149
|
+
}
|
|
5150
|
+
});
|
|
5151
|
+
}
|
|
5152
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
|
|
5153
|
+
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(
|
|
5154
|
+
PageTitleCaption,
|
|
5155
|
+
{
|
|
5156
|
+
title: "Lists",
|
|
5157
|
+
caption: "Lead lists and contact organization",
|
|
5158
|
+
rightSection: /* @__PURE__ */ jsx(Button, { leftSection: /* @__PURE__ */ jsx(IconPlus, { size: 16 }), onClick: () => setShowCreateList(true), children: "New List" })
|
|
5159
|
+
}
|
|
5160
|
+
) }),
|
|
5161
|
+
/* @__PURE__ */ jsx(Paper, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
5162
|
+
/* @__PURE__ */ jsx(
|
|
5163
|
+
FilterBar,
|
|
5164
|
+
{
|
|
5165
|
+
actions: /* @__PURE__ */ jsx(
|
|
5166
|
+
TableSelectionToolbar,
|
|
5167
|
+
{
|
|
5168
|
+
selectedCount: selection.selectedCount,
|
|
5169
|
+
onDelete: () => setShowBatchDelete(true),
|
|
5170
|
+
isDeleting: deleteListsMutation.isPending
|
|
5171
|
+
}
|
|
5172
|
+
),
|
|
5173
|
+
children: /* @__PURE__ */ jsx(
|
|
5174
|
+
TextInput,
|
|
5175
|
+
{
|
|
5176
|
+
placeholder: "Search by name...",
|
|
5177
|
+
leftSection: /* @__PURE__ */ jsx(IconSearch, { size: 16 }),
|
|
5178
|
+
value: searchQuery,
|
|
5179
|
+
onChange: (e) => setSearchQuery(e.currentTarget.value)
|
|
5180
|
+
}
|
|
5181
|
+
)
|
|
5182
|
+
}
|
|
5183
|
+
),
|
|
5184
|
+
listsLoading || telemetryLoading ? /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) : !filteredLists.length ? /* @__PURE__ */ jsx(
|
|
5185
|
+
EmptyState,
|
|
5186
|
+
{
|
|
5187
|
+
icon: IconList,
|
|
5188
|
+
title: searchQuery.trim() ? "No lists match your search" : "No lists yet",
|
|
5189
|
+
description: searchQuery.trim() ? void 0 : "Create one to get started.",
|
|
5190
|
+
action: searchQuery.trim() ? void 0 : {
|
|
5191
|
+
label: "Create List",
|
|
5192
|
+
onClick: () => setShowCreateList(true),
|
|
5193
|
+
icon: /* @__PURE__ */ jsx(IconPlus, { size: 16 })
|
|
5194
|
+
}
|
|
5195
|
+
}
|
|
5196
|
+
) : /* @__PURE__ */ jsxs(Table, { children: [
|
|
5197
|
+
/* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
5198
|
+
/* @__PURE__ */ jsx(Table.Th, { w: 40, children: /* @__PURE__ */ jsx(
|
|
5199
|
+
Checkbox,
|
|
5200
|
+
{
|
|
5201
|
+
checked: selection.isPageAllSelected,
|
|
5202
|
+
indeterminate: selection.isPagePartiallySelected,
|
|
5203
|
+
onChange: selection.togglePage
|
|
5204
|
+
}
|
|
5205
|
+
) }),
|
|
5206
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "name", sort, onToggle: toggleSort, children: "Name" }),
|
|
5207
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "description", sort, onToggle: toggleSort, children: "Description" }),
|
|
5208
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "contacts", sort, onToggle: toggleSort, children: "Contacts" }),
|
|
5209
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "created", sort, onToggle: toggleSort, children: "Created" })
|
|
5210
|
+
] }) }),
|
|
5211
|
+
/* @__PURE__ */ jsx(Table.Tbody, { children: paginatedLists.map((list) => /* @__PURE__ */ jsxs(
|
|
5212
|
+
Table.Tr,
|
|
5213
|
+
{
|
|
5214
|
+
style: { cursor: "pointer" },
|
|
5215
|
+
onClick: () => navigate({ to: "/lead-gen/lists/$listId", params: { listId: list.id } }),
|
|
5216
|
+
children: [
|
|
5217
|
+
/* @__PURE__ */ jsx(Table.Td, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(Checkbox, { checked: selection.isSelected(list.id), onChange: () => selection.toggle(list.id) }) }),
|
|
5218
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { fw: 500, children: list.name }) }),
|
|
5219
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: list.description || "-" }) }),
|
|
5220
|
+
/* @__PURE__ */ jsx(Table.Td, { children: contactCountByListId.get(list.id) ?? 0 }),
|
|
5221
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: formatDate2(list.createdAt) }) })
|
|
5222
|
+
]
|
|
5223
|
+
},
|
|
5224
|
+
list.id
|
|
5225
|
+
)) })
|
|
5226
|
+
] }),
|
|
5227
|
+
sortedLists.length > PAGE_SIZE_DEFAULT2 && /* @__PURE__ */ jsx(Group, { justify: "center", children: /* @__PURE__ */ jsx(
|
|
5228
|
+
Pagination,
|
|
5229
|
+
{
|
|
5230
|
+
value: pagination.page,
|
|
5231
|
+
onChange: pagination.setPage,
|
|
5232
|
+
total: pagination.totalPages(sortedLists.length),
|
|
5233
|
+
size: "sm"
|
|
5234
|
+
}
|
|
5235
|
+
) })
|
|
5236
|
+
] }) }),
|
|
5237
|
+
/* @__PURE__ */ jsx(
|
|
5238
|
+
CustomModal,
|
|
5239
|
+
{
|
|
5240
|
+
opened: showCreateList,
|
|
5241
|
+
onClose: () => !createListMutation.isPending && resetCreateListModal(),
|
|
5242
|
+
size: "md",
|
|
5243
|
+
loading: createListMutation.isPending,
|
|
5244
|
+
children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
5245
|
+
/* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
|
|
5246
|
+
/* @__PURE__ */ jsx(IconSparkles, { size: 24 }),
|
|
5247
|
+
/* @__PURE__ */ jsx(Title, { order: 4, children: "Create List" })
|
|
5248
|
+
] }),
|
|
5249
|
+
/* @__PURE__ */ jsx(
|
|
5250
|
+
TextInput,
|
|
5251
|
+
{
|
|
5252
|
+
label: "List Name",
|
|
5253
|
+
placeholder: "e.g. Orange County Vets Q2",
|
|
5254
|
+
value: newListName,
|
|
5255
|
+
onChange: (event) => setNewListName(event.currentTarget.value),
|
|
5256
|
+
disabled: createListMutation.isPending,
|
|
5257
|
+
required: true
|
|
5258
|
+
}
|
|
5259
|
+
),
|
|
5260
|
+
/* @__PURE__ */ jsx(
|
|
5261
|
+
Textarea,
|
|
5262
|
+
{
|
|
5263
|
+
label: "Description",
|
|
5264
|
+
placeholder: "Optional context for this list",
|
|
5265
|
+
value: newListDescription,
|
|
5266
|
+
onChange: (event) => setNewListDescription(event.currentTarget.value),
|
|
5267
|
+
disabled: createListMutation.isPending,
|
|
5268
|
+
minRows: 3
|
|
5269
|
+
}
|
|
5270
|
+
),
|
|
5271
|
+
/* @__PURE__ */ jsx(
|
|
5272
|
+
Select,
|
|
5273
|
+
{
|
|
5274
|
+
label: "Pipeline Template",
|
|
5275
|
+
data: LIST_TEMPLATE_OPTIONS.map((option) => ({
|
|
5276
|
+
value: option.value,
|
|
5277
|
+
label: option.label
|
|
5278
|
+
})),
|
|
5279
|
+
value: selectedTemplate,
|
|
5280
|
+
onChange: (value) => setSelectedTemplate(value ?? "full_pipeline"),
|
|
5281
|
+
disabled: createListMutation.isPending,
|
|
5282
|
+
allowDeselect: false
|
|
5283
|
+
}
|
|
5284
|
+
),
|
|
5285
|
+
selectedTemplateMeta ? /* @__PURE__ */ jsx(Alert, { variant: "light", color: "blue", children: /* @__PURE__ */ jsx(Text, { size: "sm", children: selectedTemplateMeta.description }) }) : null,
|
|
5286
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "The list will open in draft mode after creation so you can review configuration, edit pipeline steps, and run workflows from the detail page." }),
|
|
5287
|
+
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", children: [
|
|
5288
|
+
/* @__PURE__ */ jsx(Button, { variant: "light", onClick: resetCreateListModal, disabled: createListMutation.isPending, children: "Cancel" }),
|
|
5289
|
+
/* @__PURE__ */ jsx(Button, { onClick: handleCreateList, loading: createListMutation.isPending, disabled: !newListName.trim(), children: "Create List" })
|
|
5290
|
+
] })
|
|
5291
|
+
] })
|
|
5292
|
+
}
|
|
5293
|
+
),
|
|
5294
|
+
/* @__PURE__ */ jsx(
|
|
5295
|
+
CustomModal,
|
|
5296
|
+
{
|
|
5297
|
+
opened: showBatchDelete,
|
|
5298
|
+
onClose: () => !deleteListsMutation.isPending && setShowBatchDelete(false),
|
|
5299
|
+
size: "sm",
|
|
5300
|
+
loading: deleteListsMutation.isPending,
|
|
5301
|
+
children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
5302
|
+
/* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
|
|
5303
|
+
/* @__PURE__ */ jsx(IconAlertTriangle, { size: 24, color: "var(--color-error)" }),
|
|
5304
|
+
/* @__PURE__ */ jsxs(Title, { order: 4, children: [
|
|
5305
|
+
"Delete ",
|
|
5306
|
+
selection.selectedCount,
|
|
5307
|
+
" Lists"
|
|
5308
|
+
] })
|
|
5309
|
+
] }),
|
|
5310
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
5311
|
+
"Are you sure you want to delete",
|
|
5312
|
+
" ",
|
|
5313
|
+
/* @__PURE__ */ jsx(Text, { span: true, fw: 600, children: selection.selectedCount }),
|
|
5314
|
+
" ",
|
|
5315
|
+
"selected lists?"
|
|
5316
|
+
] }),
|
|
5317
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "This action cannot be undone." }),
|
|
5318
|
+
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", mt: "md", children: [
|
|
5319
|
+
/* @__PURE__ */ jsx(
|
|
5320
|
+
Button,
|
|
5321
|
+
{
|
|
5322
|
+
variant: "light",
|
|
5323
|
+
onClick: () => setShowBatchDelete(false),
|
|
5324
|
+
disabled: deleteListsMutation.isPending,
|
|
5325
|
+
children: "Cancel"
|
|
5326
|
+
}
|
|
5327
|
+
),
|
|
5328
|
+
/* @__PURE__ */ jsx(
|
|
5329
|
+
Button,
|
|
5330
|
+
{
|
|
5331
|
+
color: "red",
|
|
5332
|
+
loading: deleteListsMutation.isPending,
|
|
5333
|
+
onClick: () => {
|
|
5334
|
+
deleteListsMutation.mutate([...selection.selectedIds], {
|
|
5335
|
+
onSuccess: () => {
|
|
5336
|
+
setShowBatchDelete(false);
|
|
5337
|
+
selection.clear();
|
|
5338
|
+
}
|
|
5339
|
+
});
|
|
5340
|
+
},
|
|
5341
|
+
children: "Delete"
|
|
5342
|
+
}
|
|
5343
|
+
)
|
|
5344
|
+
] })
|
|
5345
|
+
] })
|
|
5346
|
+
}
|
|
5347
|
+
)
|
|
5348
|
+
] }) });
|
|
5349
|
+
}
|
|
5350
|
+
function formatDateTime2(value) {
|
|
5351
|
+
if (!value) return "Not yet";
|
|
5352
|
+
return new Date(value).toLocaleString("en-US", {
|
|
5353
|
+
month: "short",
|
|
5354
|
+
day: "numeric",
|
|
5355
|
+
year: "numeric",
|
|
5356
|
+
hour: "numeric",
|
|
5357
|
+
minute: "2-digit"
|
|
5358
|
+
});
|
|
5359
|
+
}
|
|
5360
|
+
function LeadGenListDetailPage({ listId }) {
|
|
5361
|
+
const navigate = useNavigate();
|
|
5362
|
+
const [selectedStepKey, setSelectedStepKey] = useState(null);
|
|
5363
|
+
const listQuery = useList(listId);
|
|
5364
|
+
const progressQuery = useListProgress(listId);
|
|
5365
|
+
const executionsQuery = useListExecutions(listId);
|
|
5366
|
+
const selectedStep = useMemo(
|
|
5367
|
+
() => listQuery.data?.config.pipeline?.steps?.slice().sort((a, b) => a.order - b.order).find((step) => step.key === selectedStepKey) ?? null,
|
|
5368
|
+
[listQuery.data?.config.pipeline?.steps, selectedStepKey]
|
|
5369
|
+
);
|
|
5370
|
+
const resourceDefinitionQuery = useResourceDefinition(selectedStep?.resourceId ?? "", !!selectedStep?.resourceId);
|
|
5371
|
+
const isLoading = listQuery.isLoading || progressQuery.isLoading || executionsQuery.isLoading;
|
|
5372
|
+
const error = listQuery.error ?? progressQuery.error ?? executionsQuery.error;
|
|
5373
|
+
if (isLoading) {
|
|
5374
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
5375
|
+
/* @__PURE__ */ jsx(
|
|
5376
|
+
PageTitleCaption,
|
|
5377
|
+
{
|
|
5378
|
+
title: "List Detail",
|
|
5379
|
+
caption: "Configuration, progress, and execution history for a single lead-gen list",
|
|
5380
|
+
rightSection: /* @__PURE__ */ jsx(
|
|
5381
|
+
Button,
|
|
5382
|
+
{
|
|
5383
|
+
variant: "light",
|
|
5384
|
+
size: "sm",
|
|
5385
|
+
leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }),
|
|
5386
|
+
onClick: () => navigate({ to: "/lead-gen/lists" }),
|
|
5387
|
+
children: "Lists"
|
|
5388
|
+
}
|
|
5389
|
+
)
|
|
5390
|
+
}
|
|
5391
|
+
),
|
|
5392
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) })
|
|
5393
|
+
] }) }) });
|
|
5394
|
+
}
|
|
5395
|
+
if (error) {
|
|
5396
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
5397
|
+
/* @__PURE__ */ jsx(
|
|
5398
|
+
PageTitleCaption,
|
|
5399
|
+
{
|
|
5400
|
+
title: "List Detail",
|
|
5401
|
+
caption: "Configuration, progress, and execution history for a single lead-gen list",
|
|
5402
|
+
rightSection: /* @__PURE__ */ jsx(
|
|
5403
|
+
Button,
|
|
5404
|
+
{
|
|
5405
|
+
variant: "light",
|
|
5406
|
+
size: "sm",
|
|
5407
|
+
leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }),
|
|
5408
|
+
onClick: () => navigate({ to: "/lead-gen/lists" }),
|
|
5409
|
+
children: "Lists"
|
|
5410
|
+
}
|
|
5411
|
+
)
|
|
5412
|
+
}
|
|
5413
|
+
),
|
|
5414
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(CenteredErrorState, { error, title: "Failed to load list detail" }) })
|
|
5415
|
+
] }) }) });
|
|
5416
|
+
}
|
|
5417
|
+
if (!listQuery.data || !progressQuery.data) {
|
|
5418
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
5419
|
+
/* @__PURE__ */ jsx(
|
|
5420
|
+
PageTitleCaption,
|
|
5421
|
+
{
|
|
5422
|
+
title: "List Not Found",
|
|
5423
|
+
caption: "The requested lead-gen list is unavailable.",
|
|
5424
|
+
rightSection: /* @__PURE__ */ jsx(
|
|
5425
|
+
Button,
|
|
5426
|
+
{
|
|
5427
|
+
variant: "light",
|
|
5428
|
+
size: "sm",
|
|
5429
|
+
leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }),
|
|
5430
|
+
onClick: () => navigate({ to: "/lead-gen/lists" }),
|
|
5431
|
+
children: "Lists"
|
|
5432
|
+
}
|
|
5433
|
+
)
|
|
5434
|
+
}
|
|
5435
|
+
),
|
|
5436
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { h: 240, children: /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconAlertCircle, { size: 16 }), color: "gray", variant: "light", children: "The requested list could not be found." }) }) })
|
|
5437
|
+
] }) }) });
|
|
5438
|
+
}
|
|
5439
|
+
const list = listQuery.data;
|
|
5440
|
+
const progress = progressQuery.data;
|
|
5441
|
+
const executions = executionsQuery.data ?? [];
|
|
5442
|
+
const qualification = list.config.qualification;
|
|
5443
|
+
const pipelineSteps = list.config.pipeline?.steps?.slice().sort((a, b) => a.order - b.order) ?? [];
|
|
5444
|
+
const stageTiles = [
|
|
5445
|
+
{ label: "Populated", value: progress.stageCounts.populated },
|
|
5446
|
+
{ label: "Extracted", value: progress.stageCounts.extracted },
|
|
5447
|
+
{ label: "Qualified", value: progress.stageCounts.qualified },
|
|
5448
|
+
{ label: "Discovered", value: progress.stageCounts.discovered },
|
|
5449
|
+
{ label: "Verified", value: progress.stageCounts.verified },
|
|
5450
|
+
{ label: "Personalized", value: progress.stageCounts.personalized },
|
|
5451
|
+
{ label: "Uploaded", value: progress.stageCounts.uploaded }
|
|
5452
|
+
];
|
|
5453
|
+
const deliverabilityTiles = [
|
|
5454
|
+
{ label: "Valid", value: progress.deliverability.valid },
|
|
5455
|
+
{ label: "Risky", value: progress.deliverability.risky },
|
|
5456
|
+
{ label: "Invalid", value: progress.deliverability.invalid },
|
|
5457
|
+
{ label: "Unknown", value: progress.deliverability.unknown },
|
|
5458
|
+
{ label: "Bounced", value: progress.deliverability.bounced }
|
|
5459
|
+
];
|
|
5460
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
|
|
5461
|
+
/* @__PURE__ */ jsxs(Stack, { children: [
|
|
5462
|
+
/* @__PURE__ */ jsx(
|
|
5463
|
+
PageTitleCaption,
|
|
5464
|
+
{
|
|
5465
|
+
title: list.name,
|
|
5466
|
+
caption: list.description ?? "Configuration, progress, and execution history for this list",
|
|
5467
|
+
rightSection: /* @__PURE__ */ jsx(
|
|
5468
|
+
Button,
|
|
5469
|
+
{
|
|
5470
|
+
variant: "light",
|
|
5471
|
+
size: "sm",
|
|
5472
|
+
leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }),
|
|
5473
|
+
onClick: () => navigate({ to: "/lead-gen/lists" }),
|
|
5474
|
+
children: "Lists"
|
|
5475
|
+
}
|
|
5476
|
+
)
|
|
5477
|
+
}
|
|
5478
|
+
),
|
|
5479
|
+
/* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
5480
|
+
/* @__PURE__ */ jsx(Badge, { size: "sm", variant: "light", color: getStatusColor3(list.status), children: list.status }),
|
|
5481
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
|
|
5482
|
+
"Created ",
|
|
5483
|
+
formatDateTime2(list.createdAt)
|
|
5484
|
+
] })
|
|
5485
|
+
] }),
|
|
5486
|
+
/* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 1, sm: 2, lg: 4 }, children: [
|
|
5487
|
+
/* @__PURE__ */ jsxs(Paper, { withBorder: true, p: "md", children: [
|
|
5488
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", mb: "xs", children: "Companies" }),
|
|
5489
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: progress.totalCompanies })
|
|
5490
|
+
] }),
|
|
5491
|
+
/* @__PURE__ */ jsxs(Paper, { withBorder: true, p: "md", children: [
|
|
5492
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", mb: "xs", children: "Contacts" }),
|
|
5493
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: progress.totalContacts })
|
|
5494
|
+
] }),
|
|
5495
|
+
/* @__PURE__ */ jsxs(Paper, { withBorder: true, p: "md", children: [
|
|
5496
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", mb: "xs", children: "Pipeline Steps" }),
|
|
5497
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: pipelineSteps.length })
|
|
5498
|
+
] }),
|
|
5499
|
+
/* @__PURE__ */ jsxs(Paper, { withBorder: true, p: "md", children: [
|
|
5500
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", mb: "xs", children: "Executions" }),
|
|
5501
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: executions.length })
|
|
5502
|
+
] })
|
|
5503
|
+
] }),
|
|
5504
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
5505
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: "Pipeline Progress" }),
|
|
5506
|
+
/* @__PURE__ */ jsx(SimpleGrid, { cols: { base: 2, sm: 3, lg: 7 }, children: stageTiles.map((tile) => /* @__PURE__ */ jsxs(Paper, { withBorder: true, p: "sm", children: [
|
|
5507
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: tile.label }),
|
|
5508
|
+
/* @__PURE__ */ jsx(Title, { order: 4, children: tile.value })
|
|
5509
|
+
] }, tile.label)) })
|
|
5510
|
+
] }) }),
|
|
5511
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
5512
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: "Deliverability" }),
|
|
5513
|
+
/* @__PURE__ */ jsx(SimpleGrid, { cols: { base: 2, sm: 3, lg: 5 }, children: deliverabilityTiles.map((tile) => /* @__PURE__ */ jsxs(Paper, { withBorder: true, p: "sm", children: [
|
|
5514
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: tile.label }),
|
|
5515
|
+
/* @__PURE__ */ jsx(Title, { order: 4, children: tile.value })
|
|
5516
|
+
] }, tile.label)) })
|
|
5517
|
+
] }) }),
|
|
5518
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
5519
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: "Configuration" }),
|
|
5520
|
+
/* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 1, lg: 2 }, children: [
|
|
5521
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, p: "sm", children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
5522
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, children: "Qualification" }),
|
|
5523
|
+
qualification ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5524
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
5525
|
+
"Target: ",
|
|
5526
|
+
qualification.targetDescription
|
|
5527
|
+
] }),
|
|
5528
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
5529
|
+
"Minimum reviews: ",
|
|
5530
|
+
qualification.minReviewCount
|
|
5531
|
+
] }),
|
|
5532
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
5533
|
+
"Minimum rating: ",
|
|
5534
|
+
qualification.minRating
|
|
5535
|
+
] }),
|
|
5536
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
5537
|
+
"Exclude franchises: ",
|
|
5538
|
+
qualification.excludeFranchises ? "Yes" : "No"
|
|
5539
|
+
] })
|
|
5540
|
+
] }) : /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Qualification settings are not configured for this list." })
|
|
5541
|
+
] }) }),
|
|
5542
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, p: "sm", children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
5543
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, children: "Enrichment + Personalization" }),
|
|
5544
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
5545
|
+
"Discovery provider: ",
|
|
5546
|
+
list.config.enrichment?.emailDiscovery?.primary ?? "Inherited default"
|
|
5547
|
+
] }),
|
|
5548
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
5549
|
+
"Verification provider: ",
|
|
5550
|
+
list.config.enrichment?.emailVerification?.provider ?? "Inherited default"
|
|
5551
|
+
] }),
|
|
5552
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
5553
|
+
"Industry context: ",
|
|
5554
|
+
list.config.personalization?.industryContext ?? "Inherited default"
|
|
5555
|
+
] }),
|
|
5556
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
5557
|
+
"Creative direction: ",
|
|
5558
|
+
list.config.personalization?.creativeDirection ?? "Inherited default"
|
|
5559
|
+
] })
|
|
5560
|
+
] }) })
|
|
5561
|
+
] }),
|
|
5562
|
+
list.config.personalization?.emailBody ? /* @__PURE__ */ jsxs(Box, { children: [
|
|
5563
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, mb: "xs", children: "Email Body Template" }),
|
|
5564
|
+
/* @__PURE__ */ jsx(Code, { block: true, children: list.config.personalization.emailBody })
|
|
5565
|
+
] }) : null
|
|
5566
|
+
] }) }),
|
|
5567
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
5568
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: "Pipeline Steps" }),
|
|
5569
|
+
!pipelineSteps.length ? /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconAlertCircle, { size: 16 }), color: "gray", variant: "light", children: "This list does not have any configured pipeline steps yet." }) : /* @__PURE__ */ jsxs(Table, { children: [
|
|
5570
|
+
/* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
5571
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Order" }),
|
|
5572
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Step" }),
|
|
5573
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Resource" }),
|
|
5574
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Status" }),
|
|
5575
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Action" })
|
|
5576
|
+
] }) }),
|
|
5577
|
+
/* @__PURE__ */ jsx(Table.Tbody, { children: pipelineSteps.map((step) => /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
5578
|
+
/* @__PURE__ */ jsx(Table.Td, { children: step.order }),
|
|
5579
|
+
/* @__PURE__ */ jsxs(Table.Td, { children: [
|
|
5580
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: step.label }),
|
|
5581
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: step.key })
|
|
5582
|
+
] }),
|
|
5583
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Code, { children: step.resourceId }) }),
|
|
5584
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { size: "sm", variant: step.enabled ? "light" : "outline", color: step.enabled ? "green" : "gray", children: step.enabled ? "Enabled" : "Disabled" }) }),
|
|
5585
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(
|
|
5586
|
+
Button,
|
|
5587
|
+
{
|
|
5588
|
+
size: "xs",
|
|
5589
|
+
variant: "light",
|
|
5590
|
+
leftSection: /* @__PURE__ */ jsx(IconPlayerPlay, { size: 14 }),
|
|
5591
|
+
disabled: !step.enabled,
|
|
5592
|
+
onClick: () => setSelectedStepKey(step.key),
|
|
5593
|
+
children: "Run"
|
|
5594
|
+
}
|
|
5595
|
+
) })
|
|
5596
|
+
] }, step.key)) })
|
|
5597
|
+
] })
|
|
5598
|
+
] }) }),
|
|
5599
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, p: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
5600
|
+
/* @__PURE__ */ jsx(Title, { order: 3, children: "Execution History" }),
|
|
5601
|
+
!executions.length ? /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconClockHour4, { size: 16 }), color: "gray", variant: "light", children: "No executions recorded for this list yet." }) : /* @__PURE__ */ jsxs(Table, { children: [
|
|
5602
|
+
/* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
5603
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Resource" }),
|
|
5604
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Status" }),
|
|
5605
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Started" }),
|
|
5606
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Completed" }),
|
|
5607
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Duration" })
|
|
5608
|
+
] }) }),
|
|
5609
|
+
/* @__PURE__ */ jsx(Table.Tbody, { children: executions.map((execution) => /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
5610
|
+
/* @__PURE__ */ jsxs(Table.Td, { children: [
|
|
5611
|
+
/* @__PURE__ */ jsx(Text, { fw: 500, children: execution.resourceId }),
|
|
5612
|
+
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: execution.executionId })
|
|
5613
|
+
] }),
|
|
5614
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { size: "sm", variant: "light", color: getStatusColor3(execution.status), children: execution.status }) }),
|
|
5615
|
+
/* @__PURE__ */ jsx(Table.Td, { children: formatDateTime2(execution.createdAt) }),
|
|
5616
|
+
/* @__PURE__ */ jsx(Table.Td, { children: formatDateTime2(execution.completedAt) }),
|
|
5617
|
+
/* @__PURE__ */ jsx(Table.Td, { children: execution.durationMs == null ? "n/a" : `${execution.durationMs} ms` })
|
|
5618
|
+
] }, execution.executionId)) })
|
|
5619
|
+
] })
|
|
5620
|
+
] }) })
|
|
5621
|
+
] }),
|
|
5622
|
+
selectedStep ? /* @__PURE__ */ jsx(
|
|
5623
|
+
ResourceExecuteDialog,
|
|
5624
|
+
{
|
|
5625
|
+
opened: !!selectedStep && !resourceDefinitionQuery.isLoading,
|
|
5626
|
+
onClose: () => setSelectedStepKey(null),
|
|
5627
|
+
resource: {
|
|
5628
|
+
resourceId: selectedStep.resourceId,
|
|
5629
|
+
resourceType: "workflow",
|
|
5630
|
+
name: selectedStep.label,
|
|
5631
|
+
formSchema: resourceDefinitionQuery.data?.interface?.form
|
|
5632
|
+
}
|
|
5633
|
+
}
|
|
5634
|
+
) : null,
|
|
5635
|
+
/* @__PURE__ */ jsx(
|
|
5636
|
+
Modal,
|
|
5637
|
+
{
|
|
5638
|
+
opened: resourceDefinitionQuery.isLoading && !!selectedStep,
|
|
5639
|
+
onClose: () => setSelectedStepKey(null),
|
|
5640
|
+
withCloseButton: false,
|
|
5641
|
+
centered: true,
|
|
5642
|
+
children: /* @__PURE__ */ jsx(Center, { p: "md", children: /* @__PURE__ */ jsx(Loader, {}) })
|
|
5643
|
+
}
|
|
5644
|
+
)
|
|
5645
|
+
] }) });
|
|
5646
|
+
}
|
|
5647
|
+
var PAGE_SIZE_DEFAULT3 = 20;
|
|
5648
|
+
function LeadGenCompaniesPage() {
|
|
5649
|
+
const [companySearch, setCompanySearch] = useState("");
|
|
5650
|
+
const [segmentFilter, setSegmentFilter] = useState(null);
|
|
5651
|
+
const [categoryFilter, setCategoryFilter] = useState(null);
|
|
5652
|
+
const [statusFilter, setStatusFilter] = useState(null);
|
|
5653
|
+
const [selectedCompany, setSelectedCompany] = useState(null);
|
|
5654
|
+
const [showBatchDelete, setShowBatchDelete] = useState(false);
|
|
5655
|
+
const { data: companies, isLoading: companiesLoading } = useCompanies({
|
|
5656
|
+
search: companySearch || void 0,
|
|
5657
|
+
segment: segmentFilter || void 0,
|
|
5658
|
+
category: categoryFilter || void 0,
|
|
5659
|
+
status: statusFilter === "active" || statusFilter === "invalid" ? statusFilter : void 0
|
|
5660
|
+
});
|
|
5661
|
+
const deleteCompaniesMutation = useDeleteCompanies();
|
|
5662
|
+
const { sort, toggleSort } = useTableSort("company", "asc");
|
|
5663
|
+
const sortAccessors2 = useMemo(
|
|
5664
|
+
() => ({
|
|
5665
|
+
company: (company) => company.name,
|
|
5666
|
+
domain: (company) => company.domain || "",
|
|
5667
|
+
segment: (company) => company.segment || "",
|
|
5668
|
+
category: (company) => company.category || "",
|
|
5669
|
+
employees: (company) => company.numEmployees ?? 0,
|
|
5670
|
+
enrichment: (company) => getEnrichmentStatus(company.enrichmentData),
|
|
5671
|
+
contacts: (company) => company.contactCount
|
|
5672
|
+
}),
|
|
5673
|
+
[]
|
|
5674
|
+
);
|
|
5675
|
+
const sortedCompanies = useMemo(
|
|
5676
|
+
() => sortData(companies ?? [], sort, sortAccessors2),
|
|
5677
|
+
[companies, sort, sortAccessors2]
|
|
5678
|
+
);
|
|
5679
|
+
const pagination = usePaginationState(PAGE_SIZE_DEFAULT3, [companySearch, segmentFilter, categoryFilter, statusFilter], sortedCompanies.length);
|
|
5680
|
+
const paginatedCompanies = useMemo(
|
|
5681
|
+
() => sortedCompanies.slice(pagination.offset, pagination.offset + PAGE_SIZE_DEFAULT3),
|
|
5682
|
+
[sortedCompanies, pagination.offset]
|
|
5683
|
+
);
|
|
5684
|
+
const selection = useTableSelection(paginatedCompanies, sortedCompanies);
|
|
5685
|
+
function handleBatchDelete() {
|
|
5686
|
+
deleteCompaniesMutation.mutate([...selection.selectedIds], {
|
|
5687
|
+
onSuccess: () => {
|
|
5688
|
+
selection.clear();
|
|
5689
|
+
setShowBatchDelete(false);
|
|
5690
|
+
}
|
|
5691
|
+
});
|
|
4117
5692
|
}
|
|
4118
|
-
|
|
5693
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
|
|
5694
|
+
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title: "Companies", caption: "Company records and enrichment tracking" }) }),
|
|
5695
|
+
/* @__PURE__ */ jsx(Paper, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
5696
|
+
/* @__PURE__ */ jsxs(
|
|
5697
|
+
FilterBar,
|
|
5698
|
+
{
|
|
5699
|
+
actions: /* @__PURE__ */ jsx(
|
|
5700
|
+
TableSelectionToolbar,
|
|
5701
|
+
{
|
|
5702
|
+
selectedCount: selection.selectedCount,
|
|
5703
|
+
onDelete: () => setShowBatchDelete(true),
|
|
5704
|
+
isDeleting: deleteCompaniesMutation.isPending
|
|
5705
|
+
}
|
|
5706
|
+
),
|
|
5707
|
+
children: [
|
|
5708
|
+
/* @__PURE__ */ jsx(
|
|
5709
|
+
Select,
|
|
5710
|
+
{
|
|
5711
|
+
placeholder: "All Segments",
|
|
5712
|
+
data: ["Technology", "Marketing", "Finance", "Healthcare"],
|
|
5713
|
+
value: segmentFilter,
|
|
5714
|
+
onChange: setSegmentFilter,
|
|
5715
|
+
style: { minWidth: 180 },
|
|
5716
|
+
size: "sm",
|
|
5717
|
+
clearable: true
|
|
5718
|
+
}
|
|
5719
|
+
),
|
|
5720
|
+
/* @__PURE__ */ jsx(
|
|
5721
|
+
Select,
|
|
5722
|
+
{
|
|
5723
|
+
placeholder: "All Categories",
|
|
5724
|
+
data: ["SaaS", "Service Agency", "Software"],
|
|
5725
|
+
value: categoryFilter,
|
|
5726
|
+
onChange: setCategoryFilter,
|
|
5727
|
+
style: { minWidth: 160 },
|
|
5728
|
+
size: "sm",
|
|
5729
|
+
clearable: true
|
|
5730
|
+
}
|
|
5731
|
+
),
|
|
5732
|
+
/* @__PURE__ */ jsx(
|
|
5733
|
+
Select,
|
|
5734
|
+
{
|
|
5735
|
+
placeholder: "All Statuses",
|
|
5736
|
+
data: [
|
|
5737
|
+
{ value: "active", label: "Active" },
|
|
5738
|
+
{ value: "invalid", label: "Invalid" }
|
|
5739
|
+
],
|
|
5740
|
+
value: statusFilter,
|
|
5741
|
+
onChange: setStatusFilter,
|
|
5742
|
+
style: { minWidth: 160 },
|
|
5743
|
+
size: "sm",
|
|
5744
|
+
clearable: true
|
|
5745
|
+
}
|
|
5746
|
+
),
|
|
5747
|
+
/* @__PURE__ */ jsx(
|
|
5748
|
+
TextInput,
|
|
5749
|
+
{
|
|
5750
|
+
placeholder: "Search by name or domain...",
|
|
5751
|
+
leftSection: /* @__PURE__ */ jsx(IconSearch, { size: 16 }),
|
|
5752
|
+
style: { minWidth: 250 },
|
|
5753
|
+
size: "sm",
|
|
5754
|
+
value: companySearch,
|
|
5755
|
+
onChange: (e) => setCompanySearch(e.target.value)
|
|
5756
|
+
}
|
|
5757
|
+
)
|
|
5758
|
+
]
|
|
5759
|
+
}
|
|
5760
|
+
),
|
|
5761
|
+
companiesLoading ? /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) : !sortedCompanies.length ? /* @__PURE__ */ jsx(EmptyState, { icon: IconBuildingFactory2, title: "No companies yet", description: "Add one to get started." }) : /* @__PURE__ */ jsxs(Table, { children: [
|
|
5762
|
+
/* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
5763
|
+
/* @__PURE__ */ jsx(Table.Th, { w: 40, children: /* @__PURE__ */ jsx(
|
|
5764
|
+
Checkbox,
|
|
5765
|
+
{
|
|
5766
|
+
checked: selection.isPageAllSelected,
|
|
5767
|
+
indeterminate: selection.isPagePartiallySelected,
|
|
5768
|
+
onChange: selection.togglePage
|
|
5769
|
+
}
|
|
5770
|
+
) }),
|
|
5771
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "company", sort, onToggle: toggleSort, children: "Company" }),
|
|
5772
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "domain", sort, onToggle: toggleSort, children: "Domain" }),
|
|
5773
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "segment", sort, onToggle: toggleSort, children: "Segment" }),
|
|
5774
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "category", sort, onToggle: toggleSort, children: "Category" }),
|
|
5775
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "employees", sort, onToggle: toggleSort, children: "Employees" }),
|
|
5776
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "enrichment", sort, onToggle: toggleSort, children: "Enrichment" }),
|
|
5777
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "contacts", sort, onToggle: toggleSort, children: "Contacts" })
|
|
5778
|
+
] }) }),
|
|
5779
|
+
/* @__PURE__ */ jsx(Table.Tbody, { children: paginatedCompanies.map((company) => {
|
|
5780
|
+
const enrichStatus = getEnrichmentStatus(company.enrichmentData);
|
|
5781
|
+
return /* @__PURE__ */ jsxs(
|
|
5782
|
+
Table.Tr,
|
|
5783
|
+
{
|
|
5784
|
+
style: { cursor: "pointer" },
|
|
5785
|
+
onClick: () => setSelectedCompany(company),
|
|
5786
|
+
children: [
|
|
5787
|
+
/* @__PURE__ */ jsx(
|
|
5788
|
+
Table.Td,
|
|
5789
|
+
{
|
|
5790
|
+
onClick: (e) => {
|
|
5791
|
+
e.stopPropagation();
|
|
5792
|
+
selection.toggle(company.id);
|
|
5793
|
+
},
|
|
5794
|
+
children: /* @__PURE__ */ jsx(
|
|
5795
|
+
Checkbox,
|
|
5796
|
+
{
|
|
5797
|
+
checked: selection.isSelected(company.id),
|
|
5798
|
+
onChange: () => selection.toggle(company.id),
|
|
5799
|
+
onClick: (e) => e.stopPropagation()
|
|
5800
|
+
}
|
|
5801
|
+
)
|
|
5802
|
+
}
|
|
5803
|
+
),
|
|
5804
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { fw: 500, children: company.name }) }),
|
|
5805
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: company.domain || "-" }) }),
|
|
5806
|
+
/* @__PURE__ */ jsx(Table.Td, { children: company.segment || "-" }),
|
|
5807
|
+
/* @__PURE__ */ jsx(Table.Td, { children: company.category || "-" }),
|
|
5808
|
+
/* @__PURE__ */ jsx(Table.Td, { children: company.numEmployees || "-" }),
|
|
5809
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { variant: "light", color: getEnrichmentColor(enrichStatus), size: "sm", children: enrichStatus }) }),
|
|
5810
|
+
/* @__PURE__ */ jsx(Table.Td, { children: company.contactCount })
|
|
5811
|
+
]
|
|
5812
|
+
},
|
|
5813
|
+
company.id
|
|
5814
|
+
);
|
|
5815
|
+
}) })
|
|
5816
|
+
] }),
|
|
5817
|
+
sortedCompanies.length > PAGE_SIZE_DEFAULT3 ? /* @__PURE__ */ jsx(Group, { justify: "center", children: /* @__PURE__ */ jsx(
|
|
5818
|
+
Pagination,
|
|
5819
|
+
{
|
|
5820
|
+
value: pagination.page,
|
|
5821
|
+
onChange: pagination.setPage,
|
|
5822
|
+
total: pagination.totalPages(sortedCompanies.length),
|
|
5823
|
+
size: "sm"
|
|
5824
|
+
}
|
|
5825
|
+
) }) : null
|
|
5826
|
+
] }) }),
|
|
5827
|
+
/* @__PURE__ */ jsx(CompanyDetailModal, { company: selectedCompany, onClose: () => setSelectedCompany(null) }),
|
|
5828
|
+
/* @__PURE__ */ jsx(CustomModal, { opened: showBatchDelete, onClose: () => setShowBatchDelete(false), size: "sm", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
5829
|
+
/* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
|
|
5830
|
+
/* @__PURE__ */ jsx(IconAlertTriangle, { size: 20, color: "var(--mantine-color-red-6)" }),
|
|
5831
|
+
/* @__PURE__ */ jsxs(Title, { order: 5, children: [
|
|
5832
|
+
"Delete ",
|
|
5833
|
+
selection.selectedCount,
|
|
5834
|
+
" companies?"
|
|
5835
|
+
] })
|
|
5836
|
+
] }),
|
|
5837
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "This will permanently delete the selected companies and cannot be undone." }),
|
|
5838
|
+
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", gap: "sm", children: [
|
|
5839
|
+
/* @__PURE__ */ jsx(Button, { variant: "default", size: "sm", onClick: () => setShowBatchDelete(false), children: "Cancel" }),
|
|
5840
|
+
/* @__PURE__ */ jsx(Button, { color: "red", size: "sm", loading: deleteCompaniesMutation.isPending, onClick: handleBatchDelete, children: "Delete" })
|
|
5841
|
+
] })
|
|
5842
|
+
] }) })
|
|
5843
|
+
] }) });
|
|
5844
|
+
}
|
|
5845
|
+
var PAGE_SIZE_DEFAULT4 = 20;
|
|
5846
|
+
function LeadGenContactsPage() {
|
|
5847
|
+
const [contactSearch, setContactSearch] = useState("");
|
|
5848
|
+
const [statusFilter, setStatusFilter] = useState(null);
|
|
5849
|
+
const [listFilter, setListFilter] = useState(null);
|
|
5850
|
+
const [selectedContact, setSelectedContact] = useState(null);
|
|
5851
|
+
const [showBatchDelete, setShowBatchDelete] = useState(false);
|
|
5852
|
+
const { data: lists } = useLists();
|
|
5853
|
+
const { data: contacts, isLoading: contactsLoading } = useContacts({
|
|
5854
|
+
search: contactSearch || void 0,
|
|
5855
|
+
contactStatus: statusFilter === "active" || statusFilter === "invalid" ? statusFilter : void 0,
|
|
5856
|
+
listId: listFilter || void 0
|
|
5857
|
+
});
|
|
5858
|
+
const deleteContactsMutation = useDeleteContacts();
|
|
5859
|
+
const { sort, toggleSort } = useTableSort("name", "asc");
|
|
5860
|
+
const sortAccessors2 = useMemo(
|
|
5861
|
+
() => ({
|
|
5862
|
+
name: (contact) => [contact.firstName, contact.lastName].filter(Boolean).join(" ") || contact.email,
|
|
5863
|
+
email: (contact) => contact.email,
|
|
5864
|
+
company: (contact) => contact.company?.name || "",
|
|
5865
|
+
title: (contact) => contact.title || "",
|
|
5866
|
+
status: (contact) => contact.status || "",
|
|
5867
|
+
personalized: (contact) => contact.openingLine ? "yes" : "no"
|
|
5868
|
+
}),
|
|
5869
|
+
[]
|
|
5870
|
+
);
|
|
5871
|
+
const sortedContacts = useMemo(
|
|
5872
|
+
() => sortData(contacts ?? [], sort, sortAccessors2),
|
|
5873
|
+
[contacts, sort, sortAccessors2]
|
|
5874
|
+
);
|
|
5875
|
+
const pagination = usePaginationState(PAGE_SIZE_DEFAULT4, [contactSearch, statusFilter, listFilter], sortedContacts.length);
|
|
5876
|
+
const paginatedContacts = useMemo(
|
|
5877
|
+
() => sortedContacts.slice(pagination.offset, pagination.offset + PAGE_SIZE_DEFAULT4),
|
|
5878
|
+
[sortedContacts, pagination.offset]
|
|
5879
|
+
);
|
|
5880
|
+
const selection = useTableSelection(paginatedContacts, sortedContacts);
|
|
5881
|
+
function handleBatchDelete() {
|
|
5882
|
+
deleteContactsMutation.mutate([...selection.selectedIds], {
|
|
5883
|
+
onSuccess: () => {
|
|
5884
|
+
selection.clear();
|
|
5885
|
+
setShowBatchDelete(false);
|
|
5886
|
+
}
|
|
5887
|
+
});
|
|
5888
|
+
}
|
|
5889
|
+
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
|
|
5890
|
+
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title: "Contacts", caption: "Contact records and outreach tracking" }) }),
|
|
5891
|
+
/* @__PURE__ */ jsx(Paper, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
5892
|
+
/* @__PURE__ */ jsxs(
|
|
5893
|
+
FilterBar,
|
|
5894
|
+
{
|
|
5895
|
+
actions: /* @__PURE__ */ jsx(
|
|
5896
|
+
TableSelectionToolbar,
|
|
5897
|
+
{
|
|
5898
|
+
selectedCount: selection.selectedCount,
|
|
5899
|
+
onDelete: () => setShowBatchDelete(true),
|
|
5900
|
+
isDeleting: deleteContactsMutation.isPending
|
|
5901
|
+
}
|
|
5902
|
+
),
|
|
5903
|
+
children: [
|
|
5904
|
+
/* @__PURE__ */ jsx(
|
|
5905
|
+
Select,
|
|
5906
|
+
{
|
|
5907
|
+
placeholder: "All Statuses",
|
|
5908
|
+
data: [
|
|
5909
|
+
{ value: "active", label: "Active" },
|
|
5910
|
+
{ value: "invalid", label: "Invalid" }
|
|
5911
|
+
],
|
|
5912
|
+
value: statusFilter,
|
|
5913
|
+
onChange: setStatusFilter,
|
|
5914
|
+
style: { minWidth: 160 },
|
|
5915
|
+
size: "sm",
|
|
5916
|
+
clearable: true
|
|
5917
|
+
}
|
|
5918
|
+
),
|
|
5919
|
+
/* @__PURE__ */ jsx(
|
|
5920
|
+
Select,
|
|
5921
|
+
{
|
|
5922
|
+
placeholder: "All Lists",
|
|
5923
|
+
data: (lists ?? []).map((list) => ({ value: list.id, label: list.name })),
|
|
5924
|
+
value: listFilter,
|
|
5925
|
+
onChange: setListFilter,
|
|
5926
|
+
style: { minWidth: 200 },
|
|
5927
|
+
size: "sm",
|
|
5928
|
+
clearable: true
|
|
5929
|
+
}
|
|
5930
|
+
),
|
|
5931
|
+
/* @__PURE__ */ jsx(
|
|
5932
|
+
TextInput,
|
|
5933
|
+
{
|
|
5934
|
+
placeholder: "Search by name or email...",
|
|
5935
|
+
leftSection: /* @__PURE__ */ jsx(IconSearch, { size: 16 }),
|
|
5936
|
+
style: { minWidth: 250 },
|
|
5937
|
+
size: "sm",
|
|
5938
|
+
value: contactSearch,
|
|
5939
|
+
onChange: (e) => setContactSearch(e.target.value)
|
|
5940
|
+
}
|
|
5941
|
+
)
|
|
5942
|
+
]
|
|
5943
|
+
}
|
|
5944
|
+
),
|
|
5945
|
+
contactsLoading ? /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) : !sortedContacts.length ? /* @__PURE__ */ jsx(EmptyState, { icon: IconUsers, title: "No contacts yet", description: "Add one to get started." }) : /* @__PURE__ */ jsxs(Table, { children: [
|
|
5946
|
+
/* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
5947
|
+
/* @__PURE__ */ jsx(Table.Th, { w: 40, children: /* @__PURE__ */ jsx(
|
|
5948
|
+
Checkbox,
|
|
5949
|
+
{
|
|
5950
|
+
checked: selection.isPageAllSelected,
|
|
5951
|
+
indeterminate: selection.isPagePartiallySelected,
|
|
5952
|
+
onChange: selection.togglePage
|
|
5953
|
+
}
|
|
5954
|
+
) }),
|
|
5955
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "name", sort, onToggle: toggleSort, children: "Name" }),
|
|
5956
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "email", sort, onToggle: toggleSort, children: "Email" }),
|
|
5957
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "company", sort, onToggle: toggleSort, children: "Company" }),
|
|
5958
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "title", sort, onToggle: toggleSort, children: "Title" }),
|
|
5959
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "status", sort, onToggle: toggleSort, children: "Status" }),
|
|
5960
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "personalized", sort, onToggle: toggleSort, children: "Personalized" })
|
|
5961
|
+
] }) }),
|
|
5962
|
+
/* @__PURE__ */ jsx(Table.Tbody, { children: paginatedContacts.map((contact) => {
|
|
5963
|
+
const fullName = [contact.firstName, contact.lastName].filter(Boolean).join(" ") || contact.email;
|
|
5964
|
+
const hasPersonalization = !!contact.openingLine;
|
|
5965
|
+
return /* @__PURE__ */ jsxs(
|
|
5966
|
+
Table.Tr,
|
|
5967
|
+
{
|
|
5968
|
+
style: { cursor: "pointer" },
|
|
5969
|
+
onClick: () => setSelectedContact(contact),
|
|
5970
|
+
children: [
|
|
5971
|
+
/* @__PURE__ */ jsx(
|
|
5972
|
+
Table.Td,
|
|
5973
|
+
{
|
|
5974
|
+
onClick: (e) => {
|
|
5975
|
+
e.stopPropagation();
|
|
5976
|
+
selection.toggle(contact.id);
|
|
5977
|
+
},
|
|
5978
|
+
children: /* @__PURE__ */ jsx(
|
|
5979
|
+
Checkbox,
|
|
5980
|
+
{
|
|
5981
|
+
checked: selection.isSelected(contact.id),
|
|
5982
|
+
onChange: () => selection.toggle(contact.id),
|
|
5983
|
+
onClick: (e) => e.stopPropagation()
|
|
5984
|
+
}
|
|
5985
|
+
)
|
|
5986
|
+
}
|
|
5987
|
+
),
|
|
5988
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { fw: 500, children: fullName }) }),
|
|
5989
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: contact.email }) }),
|
|
5990
|
+
/* @__PURE__ */ jsx(Table.Td, { children: contact.company?.name || "-" }),
|
|
5991
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: contact.title || "-" }) }),
|
|
5992
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { variant: "light", color: getStatusColor3(contact.status), size: "sm", children: contact.status || "unknown" }) }),
|
|
5993
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { variant: "light", color: hasPersonalization ? "green" : "gray", size: "sm", children: hasPersonalization ? "Yes" : "No" }) })
|
|
5994
|
+
]
|
|
5995
|
+
},
|
|
5996
|
+
contact.id
|
|
5997
|
+
);
|
|
5998
|
+
}) })
|
|
5999
|
+
] }),
|
|
6000
|
+
sortedContacts.length > PAGE_SIZE_DEFAULT4 ? /* @__PURE__ */ jsx(Group, { justify: "center", children: /* @__PURE__ */ jsx(
|
|
6001
|
+
Pagination,
|
|
6002
|
+
{
|
|
6003
|
+
value: pagination.page,
|
|
6004
|
+
onChange: pagination.setPage,
|
|
6005
|
+
total: pagination.totalPages(sortedContacts.length),
|
|
6006
|
+
size: "sm"
|
|
6007
|
+
}
|
|
6008
|
+
) }) : null
|
|
6009
|
+
] }) }),
|
|
6010
|
+
/* @__PURE__ */ jsx(ContactDetailModal, { contact: selectedContact, onClose: () => setSelectedContact(null) }),
|
|
6011
|
+
/* @__PURE__ */ jsx(CustomModal, { opened: showBatchDelete, onClose: () => setShowBatchDelete(false), size: "sm", children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
6012
|
+
/* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
|
|
6013
|
+
/* @__PURE__ */ jsx(IconAlertTriangle, { size: 20, color: "var(--mantine-color-red-6)" }),
|
|
6014
|
+
/* @__PURE__ */ jsxs(Title, { order: 5, children: [
|
|
6015
|
+
"Delete ",
|
|
6016
|
+
selection.selectedCount,
|
|
6017
|
+
" contacts?"
|
|
6018
|
+
] })
|
|
6019
|
+
] }),
|
|
6020
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "This will permanently delete the selected contacts and cannot be undone." }),
|
|
6021
|
+
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", gap: "sm", children: [
|
|
6022
|
+
/* @__PURE__ */ jsx(Button, { variant: "default", size: "sm", onClick: () => setShowBatchDelete(false), children: "Cancel" }),
|
|
6023
|
+
/* @__PURE__ */ jsx(Button, { color: "red", size: "sm", loading: deleteContactsMutation.isPending, onClick: handleBatchDelete, children: "Delete" })
|
|
6024
|
+
] })
|
|
6025
|
+
] }) })
|
|
6026
|
+
] }) });
|
|
6027
|
+
}
|
|
4119
6028
|
var SEOSidebarTop = () => {
|
|
4120
6029
|
return /* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconSearch, label: "SEO" });
|
|
4121
6030
|
};
|
|
@@ -4164,7 +6073,7 @@ function ringValue(completed, total) {
|
|
|
4164
6073
|
if (total === 0) return 0;
|
|
4165
6074
|
return Math.round(completed / total * 100);
|
|
4166
6075
|
}
|
|
4167
|
-
function
|
|
6076
|
+
function formatDate3(iso) {
|
|
4168
6077
|
return new Date(iso).toLocaleDateString();
|
|
4169
6078
|
}
|
|
4170
6079
|
function daysRelative(targetEndDate) {
|
|
@@ -4252,17 +6161,17 @@ function HealthStatusCard({
|
|
|
4252
6161
|
] }),
|
|
4253
6162
|
/* @__PURE__ */ jsx(Stack, { gap: 2, children: startDate && targetEndDate ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4254
6163
|
/* @__PURE__ */ jsxs(Text, { size: "sm", fw: 500, children: [
|
|
4255
|
-
|
|
6164
|
+
formatDate3(startDate),
|
|
4256
6165
|
" \u2192 ",
|
|
4257
|
-
|
|
6166
|
+
formatDate3(targetEndDate)
|
|
4258
6167
|
] }),
|
|
4259
6168
|
timeInfo && /* @__PURE__ */ jsx(Text, { size: "xs", c: timeInfo.overdue ? "red" : "dimmed", children: timeInfo.label })
|
|
4260
6169
|
] }) : startDate ? /* @__PURE__ */ jsxs(Text, { size: "sm", fw: 500, children: [
|
|
4261
6170
|
"Started ",
|
|
4262
|
-
|
|
6171
|
+
formatDate3(startDate)
|
|
4263
6172
|
] }) : targetEndDate ? /* @__PURE__ */ jsxs(Text, { size: "sm", fw: 500, children: [
|
|
4264
6173
|
"Due ",
|
|
4265
|
-
|
|
6174
|
+
formatDate3(targetEndDate)
|
|
4266
6175
|
] }) : /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "No dates set" }) })
|
|
4267
6176
|
] }) })
|
|
4268
6177
|
] });
|
|
@@ -4469,6 +6378,185 @@ var deliveryManifest = {
|
|
|
4469
6378
|
sidebar: ProjectsSidebar,
|
|
4470
6379
|
subshellRoutes: ["/projects"]
|
|
4471
6380
|
};
|
|
6381
|
+
var STATUS_OPTIONS = [
|
|
6382
|
+
{ value: "active", label: "Active" },
|
|
6383
|
+
{ value: "on_track", label: "On Track" },
|
|
6384
|
+
{ value: "at_risk", label: "At Risk" },
|
|
6385
|
+
{ value: "blocked", label: "Blocked" },
|
|
6386
|
+
{ value: "completed", label: "Completed" },
|
|
6387
|
+
{ value: "paused", label: "Paused" }
|
|
6388
|
+
];
|
|
6389
|
+
function ProjectsListPage({ onProjectClick } = {}) {
|
|
6390
|
+
const [statusFilter, setStatusFilter] = useState(null);
|
|
6391
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
6392
|
+
const [showBatchDelete, setShowBatchDelete] = useState(false);
|
|
6393
|
+
const { data: projects, isLoading, error } = useProjects();
|
|
6394
|
+
const deleteProject = useDeleteProject();
|
|
6395
|
+
const { sort, toggleSort } = useTableSort("updated");
|
|
6396
|
+
const filteredProjects = useMemo(() => {
|
|
6397
|
+
const source = projects ?? [];
|
|
6398
|
+
const query = searchQuery.trim().toLowerCase();
|
|
6399
|
+
return source.filter((project) => {
|
|
6400
|
+
const matchesStatus = !statusFilter || project.status === statusFilter;
|
|
6401
|
+
const matchesSearch = !query || project.name.toLowerCase().includes(query);
|
|
6402
|
+
return matchesStatus && matchesSearch;
|
|
6403
|
+
});
|
|
6404
|
+
}, [projects, searchQuery, statusFilter]);
|
|
6405
|
+
const sortAccessors2 = useMemo(
|
|
6406
|
+
() => ({
|
|
6407
|
+
name: (p) => p.name || "",
|
|
6408
|
+
status: (p) => p.status || "",
|
|
6409
|
+
updated: (p) => p.updated_at || ""
|
|
6410
|
+
}),
|
|
6411
|
+
[]
|
|
6412
|
+
);
|
|
6413
|
+
const sortedProjects = useMemo(() => sortData(filteredProjects, sort, sortAccessors2), [filteredProjects, sort, sortAccessors2]);
|
|
6414
|
+
const pagination = usePaginationState(PAGE_SIZE_DEFAULT, [statusFilter, searchQuery], sortedProjects.length);
|
|
6415
|
+
const paginatedProjects = useMemo(
|
|
6416
|
+
() => sortedProjects.slice(pagination.offset, pagination.offset + PAGE_SIZE_DEFAULT),
|
|
6417
|
+
[sortedProjects, pagination.offset]
|
|
6418
|
+
);
|
|
6419
|
+
const selection = useTableSelection(paginatedProjects, sortedProjects);
|
|
6420
|
+
const handleDeleteSelected = async () => {
|
|
6421
|
+
await Promise.all([...selection.selectedIds].map((projectId) => deleteProject.mutateAsync(projectId)));
|
|
6422
|
+
setShowBatchDelete(false);
|
|
6423
|
+
selection.clear();
|
|
6424
|
+
};
|
|
6425
|
+
return /* @__PURE__ */ jsxs(SubshellContentContainer, { children: [
|
|
6426
|
+
/* @__PURE__ */ jsxs(PageContainer, { children: [
|
|
6427
|
+
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title: "Projects", caption: "Client delivery tracking and milestone management" }) }),
|
|
6428
|
+
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
6429
|
+
/* @__PURE__ */ jsxs(
|
|
6430
|
+
FilterBar,
|
|
6431
|
+
{
|
|
6432
|
+
actions: /* @__PURE__ */ jsx(
|
|
6433
|
+
TableSelectionToolbar,
|
|
6434
|
+
{
|
|
6435
|
+
selectedCount: selection.selectedCount,
|
|
6436
|
+
onDelete: () => setShowBatchDelete(true),
|
|
6437
|
+
isDeleting: deleteProject.isPending
|
|
6438
|
+
}
|
|
6439
|
+
),
|
|
6440
|
+
children: [
|
|
6441
|
+
/* @__PURE__ */ jsx(
|
|
6442
|
+
Select,
|
|
6443
|
+
{
|
|
6444
|
+
placeholder: "All Statuses",
|
|
6445
|
+
data: STATUS_OPTIONS,
|
|
6446
|
+
style: { minWidth: 180 },
|
|
6447
|
+
size: "sm",
|
|
6448
|
+
clearable: true,
|
|
6449
|
+
value: statusFilter,
|
|
6450
|
+
onChange: setStatusFilter
|
|
6451
|
+
}
|
|
6452
|
+
),
|
|
6453
|
+
/* @__PURE__ */ jsx(
|
|
6454
|
+
TextInput,
|
|
6455
|
+
{
|
|
6456
|
+
placeholder: "Search by name...",
|
|
6457
|
+
leftSection: /* @__PURE__ */ jsx(IconSearch, { size: 16 }),
|
|
6458
|
+
style: { minWidth: 250 },
|
|
6459
|
+
size: "sm",
|
|
6460
|
+
value: searchQuery,
|
|
6461
|
+
onChange: (e) => setSearchQuery(e.currentTarget.value)
|
|
6462
|
+
}
|
|
6463
|
+
)
|
|
6464
|
+
]
|
|
6465
|
+
}
|
|
6466
|
+
),
|
|
6467
|
+
isLoading ? /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) : error ? /* @__PURE__ */ jsx(CenteredErrorState, { error, title: "Failed to load projects" }) : !sortedProjects.length ? /* @__PURE__ */ jsx(EmptyState, { icon: IconBriefcase, title: "No projects found" }) : /* @__PURE__ */ jsxs(Table, { children: [
|
|
6468
|
+
/* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
6469
|
+
/* @__PURE__ */ jsx(Table.Th, { w: 40, children: /* @__PURE__ */ jsx(
|
|
6470
|
+
Checkbox,
|
|
6471
|
+
{
|
|
6472
|
+
checked: selection.isPageAllSelected,
|
|
6473
|
+
indeterminate: selection.isPagePartiallySelected,
|
|
6474
|
+
onChange: selection.togglePage
|
|
6475
|
+
}
|
|
6476
|
+
) }),
|
|
6477
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "name", sort, onToggle: toggleSort, children: "Name" }),
|
|
6478
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "status", sort, onToggle: toggleSort, children: "Status" }),
|
|
6479
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Milestones" }),
|
|
6480
|
+
/* @__PURE__ */ jsx(Table.Th, { children: "Tasks" }),
|
|
6481
|
+
/* @__PURE__ */ jsx(SortableHeader, { column: "updated", sort, onToggle: toggleSort, children: "Updated" })
|
|
6482
|
+
] }) }),
|
|
6483
|
+
/* @__PURE__ */ jsx(Table.Tbody, { children: paginatedProjects.map((project) => {
|
|
6484
|
+
const completedMilestones = project.completedMilestones ?? 0;
|
|
6485
|
+
const milestoneCount = project.milestoneCount ?? 0;
|
|
6486
|
+
const completedTasks = project.completedTasks ?? 0;
|
|
6487
|
+
const taskCount = project.taskCount ?? 0;
|
|
6488
|
+
const rowProps = onProjectClick ? {
|
|
6489
|
+
style: { cursor: "pointer" },
|
|
6490
|
+
onClick: () => onProjectClick(project.id)
|
|
6491
|
+
} : void 0;
|
|
6492
|
+
return /* @__PURE__ */ jsxs(Table.Tr, { ...rowProps, children: [
|
|
6493
|
+
/* @__PURE__ */ jsx(Table.Td, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(
|
|
6494
|
+
Checkbox,
|
|
6495
|
+
{
|
|
6496
|
+
checked: selection.isSelected(project.id),
|
|
6497
|
+
onChange: () => selection.toggle(project.id)
|
|
6498
|
+
}
|
|
6499
|
+
) }),
|
|
6500
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { fw: 500, children: project.name }) }),
|
|
6501
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { variant: "light", color: projectStatusColors[project.status || ""] || "gray", size: "sm", children: formatStatusLabel(project.status || "unknown") }) }),
|
|
6502
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
6503
|
+
completedMilestones,
|
|
6504
|
+
"/",
|
|
6505
|
+
milestoneCount
|
|
6506
|
+
] }) }),
|
|
6507
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
6508
|
+
completedTasks,
|
|
6509
|
+
"/",
|
|
6510
|
+
taskCount
|
|
6511
|
+
] }) }),
|
|
6512
|
+
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: formatTimeAgo(project.updated_at) }) })
|
|
6513
|
+
] }, project.id);
|
|
6514
|
+
}) })
|
|
6515
|
+
] }),
|
|
6516
|
+
sortedProjects.length > PAGE_SIZE_DEFAULT && /* @__PURE__ */ jsx(Group, { justify: "center", children: /* @__PURE__ */ jsx(
|
|
6517
|
+
Pagination,
|
|
6518
|
+
{
|
|
6519
|
+
value: pagination.page,
|
|
6520
|
+
onChange: pagination.setPage,
|
|
6521
|
+
total: pagination.totalPages(sortedProjects.length),
|
|
6522
|
+
size: "sm"
|
|
6523
|
+
}
|
|
6524
|
+
) })
|
|
6525
|
+
] }) })
|
|
6526
|
+
] }),
|
|
6527
|
+
/* @__PURE__ */ jsx(
|
|
6528
|
+
CustomModal,
|
|
6529
|
+
{
|
|
6530
|
+
opened: showBatchDelete,
|
|
6531
|
+
onClose: () => !deleteProject.isPending && setShowBatchDelete(false),
|
|
6532
|
+
size: "sm",
|
|
6533
|
+
loading: deleteProject.isPending,
|
|
6534
|
+
children: /* @__PURE__ */ jsxs(Stack, { gap: "md", children: [
|
|
6535
|
+
/* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
|
|
6536
|
+
/* @__PURE__ */ jsx(IconAlertTriangle, { size: 24, color: "var(--color-error)" }),
|
|
6537
|
+
/* @__PURE__ */ jsxs(Title, { order: 4, children: [
|
|
6538
|
+
"Delete ",
|
|
6539
|
+
selection.selectedCount,
|
|
6540
|
+
" Projects"
|
|
6541
|
+
] })
|
|
6542
|
+
] }),
|
|
6543
|
+
/* @__PURE__ */ jsxs(Text, { size: "sm", children: [
|
|
6544
|
+
"Are you sure you want to delete",
|
|
6545
|
+
" ",
|
|
6546
|
+
/* @__PURE__ */ jsx(Text, { span: true, fw: 600, children: selection.selectedCount }),
|
|
6547
|
+
" ",
|
|
6548
|
+
"selected projects?"
|
|
6549
|
+
] }),
|
|
6550
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "This action cannot be undone." }),
|
|
6551
|
+
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", mt: "md", children: [
|
|
6552
|
+
/* @__PURE__ */ jsx(Button, { variant: "light", onClick: () => setShowBatchDelete(false), disabled: deleteProject.isPending, children: "Cancel" }),
|
|
6553
|
+
/* @__PURE__ */ jsx(Button, { color: "red", loading: deleteProject.isPending, onClick: () => void handleDeleteSelected(), children: "Delete" })
|
|
6554
|
+
] })
|
|
6555
|
+
] })
|
|
6556
|
+
}
|
|
6557
|
+
)
|
|
6558
|
+
] });
|
|
6559
|
+
}
|
|
4472
6560
|
function NotificationPanel({ notifications, isLoading, onClose, onNavigate }) {
|
|
4473
6561
|
const markAllAsRead = useMarkAllAsRead();
|
|
4474
6562
|
const hasUnread = notifications.some((n) => !n.read);
|
|
@@ -4521,4 +6609,4 @@ function NotificationBell({ unreadCount, onNavigate }) {
|
|
|
4521
6609
|
] });
|
|
4522
6610
|
}
|
|
4523
6611
|
|
|
4524
|
-
export { AbsoluteScheduleForm, ActivityFeedWidget, ApiKeyDisplayModal, ApiKeyList, ApiKeySettings, Breadcrumbs, CrashErrorFallback, CreateApiKeyModal, CreateScheduleModal, CrmOverview, CrmSidebar, CrmSidebarMiddle, CrmSidebarTop, DEAL_STAGES, DEFAULT_KANBAN_CONFIG, DealDrawer, DealKanbanCard, DeleteScheduleModal, DeploymentDetailModal, DeploymentList, DeploymentSettings, DeploymentStatusBadge, DocTreeNav, EditApiKeyModal, ErrorReportCard, HealthStatusCard, KanbanBoard, KnowledgeBasePage, LeadGenSidebar, LeadGenSidebarMiddle, LeadGenSidebarTop, MdxRenderer, MetricsStrip, MilestoneTimeline, MyTasksPanel, NotificationBell, NotificationPanel, PIPELINE_FUNNEL_ORDER, PipelineFunnelWidget, ProjectsSidebar, ProjectsSidebarMiddle, ProjectsSidebarTop, QuickCreateActions, RecurringScheduleForm, RelativeScheduleForm, RichTextEditor, SAVED_VIEW_PRESETS, SEOSidebar, SEOSidebarMiddle, SEOSidebarTop, SavedViewsPanel, ScheduleCard, ScheduleDetailModal, ScheduleTypeSelector, SortableHeader, TableSelectionToolbar, TaskCard, TaskScheduler, TasksDueWidget, buildErrorReport, calculateProgress, crmManifest, deliveryManifest, formatStatusLabel, leadGenManifest, mdxComponents, milestoneStatusColors, noteTypeColors, projectStatusColors, seoManifest, taskStatusColors, taskTypeColors, useCrmPipelineSummary, useCrmQuickMetrics, useRecentCrmActivity };
|
|
6612
|
+
export { AbsoluteScheduleForm, ActivityFeedWidget, ApiKeyDisplayModal, ApiKeyList, ApiKeySettings, Breadcrumbs, CrashErrorFallback, CreateApiKeyModal, CreateScheduleModal, CrmOverview, CrmSidebar, CrmSidebarMiddle, CrmSidebarTop, DEAL_STAGES, DEFAULT_KANBAN_CONFIG, DealDetailPage, DealDrawer, DealKanbanCard, DealsListPage, DeleteScheduleModal, DeploymentDetailModal, DeploymentList, DeploymentSettings, DeploymentStatusBadge, DocTreeNav, EditApiKeyModal, ErrorReportCard, HealthStatusCard, KanbanBoard, KnowledgeBasePage, LEAD_GEN_ROUTE_LINKS, LIST_TEMPLATE_OPTIONS, LeadGenCompaniesPage, LeadGenContactsPage, LeadGenDeliverabilityPage, LeadGenListDetailPage, LeadGenListsPage, LeadGenOverviewPage, LeadGenRouteShell, LeadGenSidebar, LeadGenSidebarMiddle, LeadGenSidebarTop, MdxRenderer, MetricsStrip, MilestoneTimeline, MyTasksPanel, NotificationBell, NotificationPanel, PIPELINE_FUNNEL_ORDER, PipelineFunnelWidget, ProjectsListPage, ProjectsSidebar, ProjectsSidebarMiddle, ProjectsSidebarTop, QuickCreateActions, RecurringScheduleForm, RelativeScheduleForm, RichTextEditor, SAVED_VIEW_PRESETS, SEOSidebar, SEOSidebarMiddle, SEOSidebarTop, SavedViewsPanel, ScheduleCard, ScheduleDetailModal, ScheduleTypeSelector, SortableHeader, TableSelectionToolbar, TaskCard, TaskScheduler, TasksDueWidget, buildErrorReport, buildListConfig, calculateProgress, crmManifest, deliveryManifest, formatStatusLabel, getEnrichmentColor, getStatusColor3 as getStatusColor, leadGenManifest, mdxComponents, milestoneStatusColors, noteTypeColors, projectStatusColors, seoManifest, taskStatusColors, taskTypeColors, useCrmPipelineSummary, useCrmQuickMetrics, useDeleteLists, useRecentCrmActivity };
|