@burdenoff/microfe-support 2026.817.2 → 2026.817.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/global-operations.d.ts +93 -0
- package/dist/generated/global-operations.js +220 -171
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +1525 -632
- package/dist/generated/global-types.js.map +1 -1
- package/dist/support/SupportAdminRoot.js +3 -3
- package/dist/support/SupportAdminRoot.js.map +1 -1
- package/dist/support/pages/ContactInquiriesPage.js +1 -1
- package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
- package/dist/support/pages/JobApplicationDetailPage.js +617 -564
- package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +541 -165
- package/dist/support/pages/JobApplicationsPage.js.map +1 -1
- package/dist/support/pages/JobPostingDetailPage.js +370 -230
- package/dist/support/pages/JobPostingDetailPage.js.map +1 -1
- package/dist/support/pages/JobPostingsPage.js +383 -247
- package/dist/support/pages/JobPostingsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -46,7 +46,7 @@ var _ = (_) => {
|
|
|
46
46
|
path: t(b, "applications"),
|
|
47
47
|
icon: /* @__PURE__ */ g(u, { size: 20 }),
|
|
48
48
|
order: 16,
|
|
49
|
-
group: "
|
|
49
|
+
group: "career"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
id: "support-job-postings",
|
|
@@ -54,7 +54,7 @@ var _ = (_) => {
|
|
|
54
54
|
path: t(b, "applications/postings"),
|
|
55
55
|
icon: /* @__PURE__ */ g(d, { size: 20 }),
|
|
56
56
|
order: 16.5,
|
|
57
|
-
group: "
|
|
57
|
+
group: "career"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
id: "support-interviewers",
|
|
@@ -62,7 +62,7 @@ var _ = (_) => {
|
|
|
62
62
|
path: t(b, "applications/interviewers"),
|
|
63
63
|
icon: /* @__PURE__ */ g(h, { size: 20 }),
|
|
64
64
|
order: 16.7,
|
|
65
|
-
group: "
|
|
65
|
+
group: "career"
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
id: "support-kb",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportAdminRoot.js","names":[],"sources":["../../src/support/SupportAdminRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Ticket,\n BookOpen,\n BarChart3,\n Settings,\n Mail,\n Briefcase,\n FileText,\n Users,\n} from 'lucide-react';\nimport { SupportProvider } from './providers/SupportProvider';\nimport type { NavItem, SupportRootProps } from './types';\nimport { SupportAdminRoutes } from './SupportAdminRoutes';\nimport { joinPath } from './utils';\nimport { useRegisterFooter } from './hooks/useRegisterFooter';\nimport { useSupportStore } from './store/supportStore';\n\n/**\n * Admin-facing root component for the Support microfrontend.\n *\n * Renders admin support management routes (tickets with full controls,\n * contact inquiries, KB authoring, analytics, settings).\n *\n * Use this in admin-app where platform administrators manage support operations.\n *\n * Navigation registration is optional — admin-app uses shell-owned nav\n * (NavRegistration.tsx with contentMfeProps), so registerNavItems won't be provided.\n * Other shells that pass registerNavItems will get admin nav items registered.\n *\n * For user-facing support features, use SupportUserRoot instead.\n *\n * Note: This is a UI-layer route split, not a security boundary.\n * Access control is enforced at the API/server level.\n */\nexport const SupportAdminRoot: FC<SupportRootProps> = (props) => {\n const {\n registerNavItems,\n registerFooterItems,\n basePath = '/',\n currentUser,\n workspaceId,\n organizationId,\n productId,\n } = props;\n const resetForContextChange = useSupportStore((state) => state.resetForContextChange);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n\n useEffect(() => {\n resetForContextChange();\n }, [resetForContextChange, currentUser?.id, workspaceId, organizationId, productId]);\n\n // Register admin navigation items only if the shell provides registerNavItems.\n // admin-app uses contentMfeProps (no registerNavItems) so the shell's\n // NavRegistration.tsx owns the nav — this avoids duplicate entries.\n // `t` is in the deps so labels re-register when locale flips.\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'support-tickets',\n label: tr('support.nav.tickets', 'Tickets'),\n path: joinPath(basePath, 'tickets'),\n icon: <Ticket size={20} />,\n order: 10,\n group: 'support',\n },\n {\n id: 'support-inquiries',\n label: tr('support.nav.contactInquiries', 'Contact Inquiries'),\n path: joinPath(basePath, 'inquiries'),\n icon: <Mail size={20} />,\n order: 15,\n group: 'support',\n },\n {\n id: 'support-applications',\n label: tr('support.nav.jobApplications', 'Job Applications'),\n path: joinPath(basePath, 'applications'),\n icon: <Briefcase size={20} />,\n order: 16,\n group: '
|
|
1
|
+
{"version":3,"file":"SupportAdminRoot.js","names":[],"sources":["../../src/support/SupportAdminRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Ticket,\n BookOpen,\n BarChart3,\n Settings,\n Mail,\n Briefcase,\n FileText,\n Users,\n} from 'lucide-react';\nimport { SupportProvider } from './providers/SupportProvider';\nimport type { NavItem, SupportRootProps } from './types';\nimport { SupportAdminRoutes } from './SupportAdminRoutes';\nimport { joinPath } from './utils';\nimport { useRegisterFooter } from './hooks/useRegisterFooter';\nimport { useSupportStore } from './store/supportStore';\n\n/**\n * Admin-facing root component for the Support microfrontend.\n *\n * Renders admin support management routes (tickets with full controls,\n * contact inquiries, KB authoring, analytics, settings).\n *\n * Use this in admin-app where platform administrators manage support operations.\n *\n * Navigation registration is optional — admin-app uses shell-owned nav\n * (NavRegistration.tsx with contentMfeProps), so registerNavItems won't be provided.\n * Other shells that pass registerNavItems will get admin nav items registered.\n *\n * For user-facing support features, use SupportUserRoot instead.\n *\n * Note: This is a UI-layer route split, not a security boundary.\n * Access control is enforced at the API/server level.\n */\nexport const SupportAdminRoot: FC<SupportRootProps> = (props) => {\n const {\n registerNavItems,\n registerFooterItems,\n basePath = '/',\n currentUser,\n workspaceId,\n organizationId,\n productId,\n } = props;\n const resetForContextChange = useSupportStore((state) => state.resetForContextChange);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n\n useEffect(() => {\n resetForContextChange();\n }, [resetForContextChange, currentUser?.id, workspaceId, organizationId, productId]);\n\n // Register admin navigation items only if the shell provides registerNavItems.\n // admin-app uses contentMfeProps (no registerNavItems) so the shell's\n // NavRegistration.tsx owns the nav — this avoids duplicate entries.\n // `t` is in the deps so labels re-register when locale flips.\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'support-tickets',\n label: tr('support.nav.tickets', 'Tickets'),\n path: joinPath(basePath, 'tickets'),\n icon: <Ticket size={20} />,\n order: 10,\n group: 'support',\n },\n {\n id: 'support-inquiries',\n label: tr('support.nav.contactInquiries', 'Contact Inquiries'),\n path: joinPath(basePath, 'inquiries'),\n icon: <Mail size={20} />,\n order: 15,\n group: 'support',\n },\n {\n id: 'support-applications',\n label: tr('support.nav.jobApplications', 'Job Applications'),\n path: joinPath(basePath, 'applications'),\n icon: <Briefcase size={20} />,\n order: 16,\n group: 'career',\n },\n {\n id: 'support-job-postings',\n label: tr('support.nav.jobPostings', 'Job Postings'),\n path: joinPath(basePath, 'applications/postings'),\n icon: <FileText size={20} />,\n order: 16.5,\n group: 'career',\n },\n {\n id: 'support-interviewers',\n label: tr('support.nav.interviewers', 'Interviewers'),\n path: joinPath(basePath, 'applications/interviewers'),\n icon: <Users size={20} />,\n order: 16.7,\n group: 'career',\n },\n {\n id: 'support-kb',\n label: tr('support.nav.knowledgeBase', 'Knowledge Base'),\n path: joinPath(basePath, 'kb'),\n icon: <BookOpen size={20} />,\n order: 20,\n group: 'support',\n },\n {\n id: 'support-analytics',\n label: tr('support.nav.analytics', 'Analytics'),\n path: joinPath(basePath, 'analytics'),\n icon: <BarChart3 size={20} />,\n order: 40,\n group: 'support',\n },\n {\n id: 'support-settings',\n label: tr('support.nav.settings', 'Settings'),\n path: joinPath(basePath, 'settings'),\n icon: <Settings size={20} />,\n order: 50,\n group: 'support',\n },\n ];\n\n const cleanup = registerNavItems(navItems);\n return cleanup;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registerNavItems, basePath, t]);\n\n useRegisterFooter(registerFooterItems);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading this module. Please refresh the page.\n </div>\n }\n >\n <SupportProvider {...props}>\n <SupportAdminRoutes />\n </SupportProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;;;AAsCA,IAAa,KAA0C,MAAU;CAC/D,IAAM,EACJ,qBACA,wBACA,cAAW,KACX,gBACA,gBACA,mBACA,iBACE,GACE,IAAwB,GAAiB,MAAU,EAAM,sBAAsB,EAC/E,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAa,EAAE,EAAI;AACzB,SAAO,MAAe,IAAM,IAAW;;AAwFzC,QArFA,QAAgB;AACd,KAAuB;IACtB;EAAC;EAAuB,GAAa;EAAI;EAAa;EAAgB;EAAU,CAAC,EAMpF,QAAgB;AACT,QAsEL,QADgB,EAnEY;GAC1B;IACE,IAAI;IACJ,OAAO,EAAG,uBAAuB,UAAU;IAC3C,MAAM,EAAS,GAAU,UAAU;IACnC,MAAM,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;IAC1B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO,EAAG,gCAAgC,oBAAoB;IAC9D,MAAM,EAAS,GAAU,YAAY;IACrC,MAAM,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;IACxB,OAAO;IACP,OAAO;IACR;GACD;IACE,IAA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ap-2 mb-1",
|
|
243
243
|
children: [
|
|
244
244
|
/* @__PURE__ */ h("h3", {
|
|
245
|
-
className: "text-sm font-semibold text-text-primary truncate group-hover:text-
|
|
245
|
+
className: "text-sm font-semibold text-text-primary truncate group-hover:text-primary transition-colors",
|
|
246
246
|
children: t.subject
|
|
247
247
|
}),
|
|
248
248
|
/* @__PURE__ */ h("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactInquiriesPage.js","names":[],"sources":["../../../src/support/pages/ContactInquiriesPage.tsx"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\nimport { useNavigate, useLocation } from 'react-router';\nimport { Mail, Search, Filter, Loader2, AlertCircle, ChevronDown } from 'lucide-react';\nimport { IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql/fetch';\nimport {\n useGetContactInquiriesQuery,\n type GetContactInquiriesQuery,\n} from '../../generated/global-operations';\nimport type { ContactInquiryStatus, ContactInquiryFilterInput } from '../../generated/global-types';\nimport { humanizeCategory } from '../utils';\n\ntype ContactInquiry = GetContactInquiriesQuery['contactInquiries']['items'][number];\n\nconst statusColors: Record<string, string> = {\n NEW: 'bg-status-info-bg-subtle text-status-info-text',\n REVIEWED: 'bg-status-warning-bg-subtle text-status-warning-text',\n CONVERTED: 'bg-status-success-bg-subtle text-status-success-text',\n SPAM: 'bg-status-error-bg-subtle text-status-error-text',\n ARCHIVED: 'bg-bg-sunken text-text-secondary',\n};\n\nconst statusLabels: Record<string, string> = {\n NEW: 'New',\n REVIEWED: 'Reviewed',\n CONVERTED: 'Converted',\n SPAM: 'Spam',\n ARCHIVED: 'Archived',\n};\n\nfunction formatDate(dateString: string): string {\n return new Date(dateString).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n}\n\nexport function ContactInquiriesPage() {\n const navigate = useNavigate();\n const location = useLocation();\n const queryParams = location.search;\n const [search, setSearch] = useState('');\n const [statusFilter, setStatusFilter] = useState<ContactInquiryStatus | ''>('');\n const [productFilter, setProductFilter] = useState('');\n const [showFilters, setShowFilters] = useState(false);\n const [productNames, setProductNames] = useState<Record<string, string>>({});\n // Mirror the latest map into a ref so the resolver effect can read it\n // without re-running every time we cache a freshly-resolved name.\n const productNamesRef = useRef(productNames);\n productNamesRef.current = productNames;\n\n const filter: ContactInquiryFilterInput = {};\n if (search) filter.search = search;\n if (statusFilter) filter.status = statusFilter;\n if (productFilter) filter.productId = productFilter;\n\n const { data, loading, error, fetchMore } = useGetContactInquiriesQuery({\n variables: { filter, limit: 50, offset: 0 },\n fetchPolicy: 'cache-and-network',\n });\n\n const inquiries = data?.contactInquiries?.items ?? [];\n const total = data?.contactInquiries?.total ?? 0;\n const hasMore = data?.contactInquiries?.hasMore ?? false;\n\n // Fetch product names for the filter dropdown. We key the effect off a\n // stable string so a new array reference per render doesn't retrigger.\n const productIds = Array.from(\n new Set(inquiries.flatMap((i: ContactInquiry): string[] => (i.productId ? [i.productId] : [])))\n ).sort() as string[];\n const productIdsKey = productIds.join(',');\n useEffect(() => {\n const unknownIds = productIdsKey\n ? productIdsKey.split(',').filter((pid) => !productNamesRef.current[pid])\n : [];\n if (unknownIds.length === 0) return;\n unknownIds.forEach((pid) => {\n graphqlFetch<{ platformProduct?: { name?: string } }>({\n gateway: 'global',\n query: 'query($id: ID!) { platformProduct(id: $id) { name } }',\n variables: { id: pid },\n })\n .then((result) => {\n const name = result.data?.platformProduct?.name;\n if (name) setProductNames((prev) => ({ ...prev, [pid]: name }));\n })\n .catch(() => {});\n });\n }, [productIdsKey]);\n\n const loadMore = () => {\n if (!hasMore) return;\n fetchMore({\n variables: { offset: inquiries.length },\n updateQuery: (prev, { fetchMoreResult }) => {\n if (!fetchMoreResult) return prev;\n return {\n contactInquiries: {\n ...fetchMoreResult.contactInquiries,\n items: [\n ...(prev.contactInquiries?.items ?? []),\n ...(fetchMoreResult.contactInquiries?.items ?? []),\n ],\n },\n };\n },\n });\n };\n\n // Loading state\n if (loading && inquiries.length === 0) {\n return (\n <div className=\"p-3 sm:p-6\">\n <div className=\"flex items-center gap-3 mb-6\">\n <Mail size={24} className=\"text-text-primary\" />\n <h1 className=\"text-2xl font-bold text-text-primary\">Contact Inquiries</h1>\n </div>\n <div className=\"flex flex-col items-center justify-center py-16\">\n <Loader2 size={32} className=\"animate-spin text-text-secondary mb-4\" />\n <p className=\"text-sm text-text-secondary\">Loading inquiries…</p>\n </div>\n </div>\n );\n }\n\n // Error state\n if (error) {\n return (\n <div className=\"p-3 sm:p-6\">\n <div className=\"flex items-center gap-3 mb-6\">\n <Mail size={24} className=\"text-text-primary\" />\n <h1 className=\"text-2xl font-bold text-text-primary\">Contact Inquiries</h1>\n </div>\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <div className=\"p-4 rounded-2xl bg-status-error-bg-subtle text-status-error-text mb-4\">\n <AlertCircle size={48} />\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-2\">Failed to load inquiries</h3>\n <p className=\"text-sm text-text-secondary\">{error.message}</p>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"p-3 sm:p-6\">\n {/* Header */}\n <div className=\"flex flex-col gap-3 mb-6 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex items-center gap-3\">\n <Mail size={24} className=\"text-text-primary\" />\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">Contact Inquiries</h1>\n <p className=\"text-sm text-text-secondary\">Website contact form submissions</p>\n </div>\n <span className=\"ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-bg-sunken text-text-secondary\">\n {total}\n </span>\n </div>\n </div>\n\n <PagePurpose className=\"mb-6\">\n Every message sent through your product websites' contact forms lands here. Triage\n sales and support leads, mark spam, and convert genuine inquiries into tickets so nothing\n from a prospective customer slips through the cracks. Open an inquiry to read it in full and\n take action.\n </PagePurpose>\n\n {/* Toolbar */}\n <div className=\"flex flex-col sm:flex-row gap-3 mb-6\">\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search\n size={16}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <input\n type=\"text\"\n aria-label=\"Search inquiries\"\n placeholder=\"Search by name, email, or subject...\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n className=\"w-full pl-9 pr-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n />\n </div>\n\n {/* Filter toggle */}\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors\"\n >\n <Filter size={16} />\n Filters\n <ChevronDown\n size={14}\n className={showFilters ? 'rotate-180 transition-transform' : 'transition-transform'}\n />\n </button>\n </div>\n\n {/* Filters panel */}\n {showFilters && (\n <div className=\"mb-6 p-4 bg-bg-surface border border-border-seam rounded-lg\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label\n className=\"block text-xs font-medium text-text-secondary mb-1\"\n htmlFor=\"contactinquiriespage-status-0\"\n >\n Status\n </label>\n <select\n id=\"contactinquiriespage-status-0\"\n value={statusFilter}\n onChange={(e) => setStatusFilter(e.target.value as ContactInquiryStatus | '')}\n className=\"min-h-11 w-full px-3 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n >\n <option value=\"\">All statuses</option>\n <option value=\"NEW\">New</option>\n <option value=\"REVIEWED\">Reviewed</option>\n <option value=\"CONVERTED\">Converted</option>\n <option value=\"SPAM\">Spam</option>\n <option value=\"ARCHIVED\">Archived</option>\n </select>\n </div>\n <div>\n <label\n className=\"block text-xs font-medium text-text-secondary mb-1\"\n htmlFor=\"contactinquiriespage-product-2\"\n >\n Product\n </label>\n <select\n id=\"contactinquiriespage-product-2\"\n value={productFilter}\n onChange={(e) => setProductFilter(e.target.value)}\n className=\"min-h-11 w-full px-3 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n >\n <option value=\"\">All products</option>\n {productIds.map((pid) => (\n <option key={pid} value={pid}>\n {productNames[pid] || pid}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n\n {/* Empty state */}\n {inquiries.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-notifications\"\n title=\"No inquiries yet\"\n description=\"Contact form submissions from your product websites will appear here.\"\n />\n ) : (\n <>\n {/* Inquiry list */}\n <div className=\"space-y-3\">\n {inquiries.map((inquiry: ContactInquiry) => (\n <button\n type=\"button\"\n key={inquiry.id}\n onClick={() => navigate(`/support/inquiries/${inquiry.id}${queryParams}`)}\n className=\"w-full text-left p-4 bg-bg-surface border border-border-seam rounded-lg shadow-[var(--shadow-pop)] hover:border-border-strong hover:shadow-[var(--shadow-pop-hover)] transition-[box-shadow,border-color] duration-200 group\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 mb-1\">\n <h3 className=\"text-sm font-semibold text-text-primary truncate group-hover:text-accent transition-colors\">\n {inquiry.subject}\n </h3>\n <span\n className={`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${statusColors[inquiry.status] || statusColors.NEW} ${inquiry.status === 'NEW' ? 'motion-safe:animate-vc-glow-pulse' : ''}`}\n >\n {statusLabels[inquiry.status] || inquiry.status}\n </span>\n {inquiry.productId && productNames[inquiry.productId] && (\n <span\n className=\"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-accent-purple-subtle text-accent-purple\"\n title={`Product: ${productNames[inquiry.productId]}`}\n >\n {productNames[inquiry.productId]}\n </span>\n )}\n {inquiry.category && (\n <span className=\"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-accent-blue-subtle text-accent-blue\">\n {humanizeCategory(inquiry.category)}\n </span>\n )}\n </div>\n <p className=\"text-sm text-text-secondary mb-1\">\n <span className=\"font-medium\">{inquiry.name}</span>\n <span className=\"mx-1.5 text-text-secondary/50\">·</span>\n <span>{inquiry.email}</span>\n {inquiry.company && (\n <>\n <span className=\"mx-1.5 text-text-secondary/50\">·</span>\n <span>{inquiry.company}</span>\n </>\n )}\n </p>\n <p className=\"text-xs text-text-secondary truncate\">{inquiry.message}</p>\n </div>\n <div className=\"text-xs text-text-secondary sm:whitespace-nowrap\">\n {formatDate(inquiry.createdAt)}\n </div>\n </div>\n </button>\n ))}\n </div>\n\n {/* Load more */}\n {hasMore && (\n <div className=\"flex justify-center mt-6\">\n <button\n type=\"button\"\n onClick={loadMore}\n disabled={loading}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-6 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors disabled:opacity-50\"\n >\n {loading ? <Loader2 size={14} className=\"animate-spin\" /> : null}\n Load more\n </button>\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAcA,IAAM,IAAuC;CAC3C,KAAK;CACL,UAAU;CACV,WAAW;CACX,MAAM;CACN,UAAU;CACX,EAEK,IAAuC;CAC3C,KAAK;CACL,UAAU;CACV,WAAW;CACX,MAAM;CACN,UAAU;CACX;AAED,SAAS,EAAW,GAA4B;AAC9C,QAAO,IAAI,KAAK,EAAW,CAAC,mBAAmB,SAAS;EACtD,OAAO;EACP,KAAK;EACL,MAAM;EACN,MAAM;EACN,QAAQ;EACT,CAAC;;AAGJ,SAAgB,IAAuB;CACrC,IAAM,IAAW,GAAa,EAExB,IADW,GAAa,CACD,QACvB,CAAC,GAAQ,KAAa,EAAS,GAAG,EAClC,CAAC,GAAc,KAAmB,EAAoC,GAAG,EACzE,CAAC,GAAe,KAAoB,EAAS,GA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Y,CAAA;QACrE;UACN,kBAAC,OAAD;OAAK,WAAU;iBACZ,EAAW,EAAQ,UAAU;OAC1B,CAAA,CACF;;KACC,EA9CF,EAAQ,GA8CN,CACT;IACE,CAAA,EAGL,KACC,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,UAAD;KACE,MAAK;KACL,eArOS;AAChB,WACL,EAAU;OACR,WAAW,EAAE,QAAQ,EAAU,QAAQ;OACvC,cAAc,GAAM,EAAE,yBACf,IACE,EACL,kBAAkB;QAChB,GAAG,EAAgB;QACnB,OAAO,CACL,GAAI,EAAK,kBAAkB,SAAS,EAAE,EACtC,GAAI,EAAgB,kBAAkB,SAAS,EAAE,CAClD;QACF,EACF,GAT4B;OAWhC,CAAC;;KAsNU,UAAU;KACV,WAAU;eAJZ,CAMG,IAAU,kBAAC,GAAD;MAAS,MAAM;MAAI,WAAU;MAAiB,CAAA,GAAG,MAAK,YAE1D;;IACL,CAAA,CAEP,EAAA,CAAA;GAED"}
|
|
1
|
+
{"version":3,"file":"ContactInquiriesPage.js","names":[],"sources":["../../../src/support/pages/ContactInquiriesPage.tsx"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\nimport { useNavigate, useLocation } from 'react-router';\nimport { Mail, Search, Filter, Loader2, AlertCircle, ChevronDown } from 'lucide-react';\nimport { IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql/fetch';\nimport {\n useGetContactInquiriesQuery,\n type GetContactInquiriesQuery,\n} from '../../generated/global-operations';\nimport type { ContactInquiryStatus, ContactInquiryFilterInput } from '../../generated/global-types';\nimport { humanizeCategory } from '../utils';\n\ntype ContactInquiry = GetContactInquiriesQuery['contactInquiries']['items'][number];\n\nconst statusColors: Record<string, string> = {\n NEW: 'bg-status-info-bg-subtle text-status-info-text',\n REVIEWED: 'bg-status-warning-bg-subtle text-status-warning-text',\n CONVERTED: 'bg-status-success-bg-subtle text-status-success-text',\n SPAM: 'bg-status-error-bg-subtle text-status-error-text',\n ARCHIVED: 'bg-bg-sunken text-text-secondary',\n};\n\nconst statusLabels: Record<string, string> = {\n NEW: 'New',\n REVIEWED: 'Reviewed',\n CONVERTED: 'Converted',\n SPAM: 'Spam',\n ARCHIVED: 'Archived',\n};\n\nfunction formatDate(dateString: string): string {\n return new Date(dateString).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n}\n\nexport function ContactInquiriesPage() {\n const navigate = useNavigate();\n const location = useLocation();\n const queryParams = location.search;\n const [search, setSearch] = useState('');\n const [statusFilter, setStatusFilter] = useState<ContactInquiryStatus | ''>('');\n const [productFilter, setProductFilter] = useState('');\n const [showFilters, setShowFilters] = useState(false);\n const [productNames, setProductNames] = useState<Record<string, string>>({});\n // Mirror the latest map into a ref so the resolver effect can read it\n // without re-running every time we cache a freshly-resolved name.\n const productNamesRef = useRef(productNames);\n productNamesRef.current = productNames;\n\n const filter: ContactInquiryFilterInput = {};\n if (search) filter.search = search;\n if (statusFilter) filter.status = statusFilter;\n if (productFilter) filter.productId = productFilter;\n\n const { data, loading, error, fetchMore } = useGetContactInquiriesQuery({\n variables: { filter, limit: 50, offset: 0 },\n fetchPolicy: 'cache-and-network',\n });\n\n const inquiries = data?.contactInquiries?.items ?? [];\n const total = data?.contactInquiries?.total ?? 0;\n const hasMore = data?.contactInquiries?.hasMore ?? false;\n\n // Fetch product names for the filter dropdown. We key the effect off a\n // stable string so a new array reference per render doesn't retrigger.\n const productIds = Array.from(\n new Set(inquiries.flatMap((i: ContactInquiry): string[] => (i.productId ? [i.productId] : [])))\n ).sort() as string[];\n const productIdsKey = productIds.join(',');\n useEffect(() => {\n const unknownIds = productIdsKey\n ? productIdsKey.split(',').filter((pid) => !productNamesRef.current[pid])\n : [];\n if (unknownIds.length === 0) return;\n unknownIds.forEach((pid) => {\n graphqlFetch<{ platformProduct?: { name?: string } }>({\n gateway: 'global',\n query: 'query($id: ID!) { platformProduct(id: $id) { name } }',\n variables: { id: pid },\n })\n .then((result) => {\n const name = result.data?.platformProduct?.name;\n if (name) setProductNames((prev) => ({ ...prev, [pid]: name }));\n })\n .catch(() => {});\n });\n }, [productIdsKey]);\n\n const loadMore = () => {\n if (!hasMore) return;\n fetchMore({\n variables: { offset: inquiries.length },\n updateQuery: (prev, { fetchMoreResult }) => {\n if (!fetchMoreResult) return prev;\n return {\n contactInquiries: {\n ...fetchMoreResult.contactInquiries,\n items: [\n ...(prev.contactInquiries?.items ?? []),\n ...(fetchMoreResult.contactInquiries?.items ?? []),\n ],\n },\n };\n },\n });\n };\n\n // Loading state\n if (loading && inquiries.length === 0) {\n return (\n <div className=\"p-3 sm:p-6\">\n <div className=\"flex items-center gap-3 mb-6\">\n <Mail size={24} className=\"text-text-primary\" />\n <h1 className=\"text-2xl font-bold text-text-primary\">Contact Inquiries</h1>\n </div>\n <div className=\"flex flex-col items-center justify-center py-16\">\n <Loader2 size={32} className=\"animate-spin text-text-secondary mb-4\" />\n <p className=\"text-sm text-text-secondary\">Loading inquiries…</p>\n </div>\n </div>\n );\n }\n\n // Error state\n if (error) {\n return (\n <div className=\"p-3 sm:p-6\">\n <div className=\"flex items-center gap-3 mb-6\">\n <Mail size={24} className=\"text-text-primary\" />\n <h1 className=\"text-2xl font-bold text-text-primary\">Contact Inquiries</h1>\n </div>\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <div className=\"p-4 rounded-2xl bg-status-error-bg-subtle text-status-error-text mb-4\">\n <AlertCircle size={48} />\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-2\">Failed to load inquiries</h3>\n <p className=\"text-sm text-text-secondary\">{error.message}</p>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"p-3 sm:p-6\">\n {/* Header */}\n <div className=\"flex flex-col gap-3 mb-6 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex items-center gap-3\">\n <Mail size={24} className=\"text-text-primary\" />\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">Contact Inquiries</h1>\n <p className=\"text-sm text-text-secondary\">Website contact form submissions</p>\n </div>\n <span className=\"ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-bg-sunken text-text-secondary\">\n {total}\n </span>\n </div>\n </div>\n\n <PagePurpose className=\"mb-6\">\n Every message sent through your product websites' contact forms lands here. Triage\n sales and support leads, mark spam, and convert genuine inquiries into tickets so nothing\n from a prospective customer slips through the cracks. Open an inquiry to read it in full and\n take action.\n </PagePurpose>\n\n {/* Toolbar */}\n <div className=\"flex flex-col sm:flex-row gap-3 mb-6\">\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search\n size={16}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <input\n type=\"text\"\n aria-label=\"Search inquiries\"\n placeholder=\"Search by name, email, or subject...\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n className=\"w-full pl-9 pr-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n />\n </div>\n\n {/* Filter toggle */}\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors\"\n >\n <Filter size={16} />\n Filters\n <ChevronDown\n size={14}\n className={showFilters ? 'rotate-180 transition-transform' : 'transition-transform'}\n />\n </button>\n </div>\n\n {/* Filters panel */}\n {showFilters && (\n <div className=\"mb-6 p-4 bg-bg-surface border border-border-seam rounded-lg\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label\n className=\"block text-xs font-medium text-text-secondary mb-1\"\n htmlFor=\"contactinquiriespage-status-0\"\n >\n Status\n </label>\n <select\n id=\"contactinquiriespage-status-0\"\n value={statusFilter}\n onChange={(e) => setStatusFilter(e.target.value as ContactInquiryStatus | '')}\n className=\"min-h-11 w-full px-3 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n >\n <option value=\"\">All statuses</option>\n <option value=\"NEW\">New</option>\n <option value=\"REVIEWED\">Reviewed</option>\n <option value=\"CONVERTED\">Converted</option>\n <option value=\"SPAM\">Spam</option>\n <option value=\"ARCHIVED\">Archived</option>\n </select>\n </div>\n <div>\n <label\n className=\"block text-xs font-medium text-text-secondary mb-1\"\n htmlFor=\"contactinquiriespage-product-2\"\n >\n Product\n </label>\n <select\n id=\"contactinquiriespage-product-2\"\n value={productFilter}\n onChange={(e) => setProductFilter(e.target.value)}\n className=\"min-h-11 w-full px-3 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n >\n <option value=\"\">All products</option>\n {productIds.map((pid) => (\n <option key={pid} value={pid}>\n {productNames[pid] || pid}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n\n {/* Empty state */}\n {inquiries.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-notifications\"\n title=\"No inquiries yet\"\n description=\"Contact form submissions from your product websites will appear here.\"\n />\n ) : (\n <>\n {/* Inquiry list */}\n <div className=\"space-y-3\">\n {inquiries.map((inquiry: ContactInquiry) => (\n <button\n type=\"button\"\n key={inquiry.id}\n onClick={() => navigate(`/support/inquiries/${inquiry.id}${queryParams}`)}\n className=\"w-full text-left p-4 bg-bg-surface border border-border-seam rounded-lg shadow-[var(--shadow-pop)] hover:border-border-strong hover:shadow-[var(--shadow-pop-hover)] transition-[box-shadow,border-color] duration-200 group\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 mb-1\">\n <h3 className=\"text-sm font-semibold text-text-primary truncate group-hover:text-primary transition-colors\">\n {inquiry.subject}\n </h3>\n <span\n className={`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${statusColors[inquiry.status] || statusColors.NEW} ${inquiry.status === 'NEW' ? 'motion-safe:animate-vc-glow-pulse' : ''}`}\n >\n {statusLabels[inquiry.status] || inquiry.status}\n </span>\n {inquiry.productId && productNames[inquiry.productId] && (\n <span\n className=\"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-accent-purple-subtle text-accent-purple\"\n title={`Product: ${productNames[inquiry.productId]}`}\n >\n {productNames[inquiry.productId]}\n </span>\n )}\n {inquiry.category && (\n <span className=\"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-accent-blue-subtle text-accent-blue\">\n {humanizeCategory(inquiry.category)}\n </span>\n )}\n </div>\n <p className=\"text-sm text-text-secondary mb-1\">\n <span className=\"font-medium\">{inquiry.name}</span>\n <span className=\"mx-1.5 text-text-secondary/50\">·</span>\n <span>{inquiry.email}</span>\n {inquiry.company && (\n <>\n <span className=\"mx-1.5 text-text-secondary/50\">·</span>\n <span>{inquiry.company}</span>\n </>\n )}\n </p>\n <p className=\"text-xs text-text-secondary truncate\">{inquiry.message}</p>\n </div>\n <div className=\"text-xs text-text-secondary sm:whitespace-nowrap\">\n {formatDate(inquiry.createdAt)}\n </div>\n </div>\n </button>\n ))}\n </div>\n\n {/* Load more */}\n {hasMore && (\n <div className=\"flex justify-center mt-6\">\n <button\n type=\"button\"\n onClick={loadMore}\n disabled={loading}\n className=\"min-h-11 inline-flex items-center justify-center gap-2 px-6 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors disabled:opacity-50\"\n >\n {loading ? <Loader2 size={14} className=\"animate-spin\" /> : null}\n Load more\n </button>\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAcA,IAAM,IAAuC;CAC3C,KAAK;CACL,UAAU;CACV,WAAW;CACX,MAAM;CACN,UAAU;CACX,EAEK,IAAuC;CAC3C,KAAK;CACL,UAAU;CACV,WAA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