@nukleus-sports/page-shells 0.4.0 → 0.5.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/marketing.cjs +17 -19
- package/dist/marketing.cjs.map +1 -1
- package/dist/marketing.d.cts +8 -2
- package/dist/marketing.d.ts +8 -2
- package/dist/marketing.js +17 -19
- package/dist/marketing.js.map +1 -1
- package/package.json +1 -1
package/dist/marketing.cjs
CHANGED
|
@@ -38,8 +38,7 @@ function MarketingDealsPanel({ adapter, className }) {
|
|
|
38
38
|
activeTab,
|
|
39
39
|
onTabChange,
|
|
40
40
|
currentProjectDeals,
|
|
41
|
-
|
|
42
|
-
manualDeals,
|
|
41
|
+
completedDeals,
|
|
43
42
|
currentEmptyMessage,
|
|
44
43
|
completedEmptyMessage,
|
|
45
44
|
gatedEmptyState,
|
|
@@ -58,7 +57,7 @@ function MarketingDealsPanel({ adapter, className }) {
|
|
|
58
57
|
} = adapter;
|
|
59
58
|
const [previewDeal, setPreviewDeal] = (0, import_react.useState)(null);
|
|
60
59
|
const resolvedCompletedEmptyMessage = typeof completedEmptyMessage === "function" ? completedEmptyMessage(currentProjectDeals.length > 0) : completedEmptyMessage;
|
|
61
|
-
const hasCompletedContent =
|
|
60
|
+
const hasCompletedContent = completedDeals.length > 0;
|
|
62
61
|
if (isLoading) {
|
|
63
62
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_ui_web.cn)("flex flex-col gap-3", className), children: [
|
|
64
63
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui_web.Skeleton, { className: "h-9 w-full rounded-[10px]" }),
|
|
@@ -122,35 +121,34 @@ function MarketingDealsPanel({ adapter, className }) {
|
|
|
122
121
|
},
|
|
123
122
|
deal.project_id
|
|
124
123
|
)) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_marketing.DealEmptyState, { message: currentEmptyMessage }) }),
|
|
125
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui_web.TabsContent, { value: "completed", className: "mt-0", children: !hasCompletedContent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_marketing.DealEmptyState, { message: resolvedCompletedEmptyMessage }) : /* @__PURE__ */ (0, import_jsx_runtime.
|
|
126
|
-
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui_web.TabsContent, { value: "completed", className: "mt-0", children: !hasCompletedContent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_marketing.DealEmptyState, { message: resolvedCompletedEmptyMessage }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-col gap-3 sm:gap-0", children: completedDeals.map(
|
|
125
|
+
(item) => item.kind === "project" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
127
126
|
import_marketing.ProjectDealCard,
|
|
128
127
|
{
|
|
129
|
-
deal,
|
|
128
|
+
deal: item.deal,
|
|
130
129
|
isCompleted: true,
|
|
131
|
-
collabMembership: getCollabMembership(deal.project_id),
|
|
132
|
-
collabHref: getCollabHref(deal.project_id),
|
|
133
|
-
onCollabClick: getOnCollabClick?.(deal.project_id),
|
|
130
|
+
collabMembership: getCollabMembership(item.deal.project_id),
|
|
131
|
+
collabHref: getCollabHref(item.deal.project_id),
|
|
132
|
+
onCollabClick: getOnCollabClick?.(item.deal.project_id),
|
|
134
133
|
resolveImageUrl,
|
|
135
|
-
asideFooter: getProjectDealAsideFooter?.(deal),
|
|
136
|
-
statusPill: getProjectDealStatusPill?.(deal)
|
|
134
|
+
asideFooter: getProjectDealAsideFooter?.(item.deal),
|
|
135
|
+
statusPill: getProjectDealStatusPill?.(item.deal)
|
|
137
136
|
},
|
|
138
|
-
deal.project_id
|
|
139
|
-
))
|
|
140
|
-
manualDeals.map((deal) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
137
|
+
`project-${item.deal.project_id}`
|
|
138
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
139
|
import_marketing.ManualDealCard,
|
|
142
140
|
{
|
|
143
|
-
deal,
|
|
141
|
+
deal: item.deal,
|
|
144
142
|
onPreview: setPreviewDeal,
|
|
145
143
|
onEdit: onEditDeal,
|
|
146
144
|
onDelete: onDeleteDeal,
|
|
147
145
|
onOpenDocument,
|
|
148
146
|
resolveImageUrl,
|
|
149
|
-
asideFooter: getManualDealAsideFooter?.(deal)
|
|
147
|
+
asideFooter: getManualDealAsideFooter?.(item.deal)
|
|
150
148
|
},
|
|
151
|
-
deal.id
|
|
152
|
-
)
|
|
153
|
-
|
|
149
|
+
`manual-${item.deal.id}`
|
|
150
|
+
)
|
|
151
|
+
) }) })
|
|
154
152
|
] })
|
|
155
153
|
]
|
|
156
154
|
}
|
package/dist/marketing.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marketing/index.ts","../src/marketing/marketing-deals-panel.tsx"],"sourcesContent":["export {\n MarketingDealsPanel,\n type MarketingDealsAdapter,\n type MarketingDealsPanelProps,\n} from \"./marketing-deals-panel\";\n","import { useState, type MouseEvent, type ReactNode } from \"react\";\n\nimport {\n Button,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n cn,\n} from \"@nukleus-sports/ui-web\";\nimport { type EntityImageResolver } from \"@nukleus-sports/ui-patterns\";\nimport {\n DealEmptyState,\n ManualDealCard,\n ManualDealPreviewDialog,\n ProjectDealCard,\n type ManualDeal,\n type ManualDealDocumentRef,\n type ProjectCollabMembership,\n type ProjectDeal,\n} from \"@nukleus-sports/ui-patterns/marketing\";\n\n// Reconciled from both apps -- see RECONCILIATION.md#marketing-deals-panel\n\nexport interface MarketingDealsAdapter {\n isLoading?: boolean;\n error?: boolean;\n errorMessage?: string;\n onRetry?: () => void;\n\n activeTab: \"current\" | \"completed\";\n onTabChange: (tab: \"current\" | \"completed\") => void;\n\n currentProjectDeals: ProjectDeal[];\n completedProjectDeals: ProjectDeal[];\n manualDeals: ManualDeal[];\n\n currentEmptyMessage: string;\n /** Accepts a function because nukleus-app's wording depends on whether current deals exist. */\n completedEmptyMessage: string | ((hasCurrentProjectDeals: boolean) => string);\n\n /** Replaces the Current tab's content and disables the Completed tab (nukleus-app's gating). */\n gatedEmptyState?: ReactNode;\n\n /**\n * `options` must include any \"All\" entry the caller wants — this package renders only the\n * dropdown, not the filtering logic.\n */\n completedYearFilter?: {\n options: { value: string; label: string }[];\n value: string;\n onChange: (value: string) => void;\n };\n\n /** Required because `ProjectDealCard` structurally enforces the collab-membership check. */\n getCollabMembership: (projectId: string) => ProjectCollabMembership;\n getCollabHref: (projectId: string) => string;\n /** nukleus-app's demo-mode upsell toast swaps the collab link for a button here. */\n getOnCollabClick?: (\n projectId: string,\n ) => ((e: MouseEvent<HTMLButtonElement>) => void) | undefined;\n\n onEditDeal?: (deal: ManualDeal) => void;\n onDeleteDeal?: (deal: ManualDeal) => void;\n onOpenDocument: (doc: ManualDealDocumentRef) => void;\n\n /** Shown beside \"Client Name\" in the manual deal preview dialog; omit for no avatar. */\n clientImageUrl?: string | null;\n resolveImageUrl?: EntityImageResolver;\n\n /** Rendered via `asideFooter`; `ManualDealCard` shows it on desktop only (see that component). */\n getProjectDealAsideFooter?: (deal: ProjectDeal) => ReactNode;\n getManualDealAsideFooter?: (deal: ManualDeal) => ReactNode;\n\n /** Overrides the computed Active/Upcoming/Complete status pill -- for a\n * caller whose own saved status has more states dates alone can't express. */\n getProjectDealStatusPill?: (deal: ProjectDeal) => ReactNode;\n}\n\nexport interface MarketingDealsPanelProps {\n adapter: MarketingDealsAdapter;\n className?: string;\n}\n\nexport function MarketingDealsPanel({ adapter, className }: MarketingDealsPanelProps) {\n const {\n isLoading,\n error,\n errorMessage = \"Could not load marketing deals. Please try again.\",\n onRetry,\n activeTab,\n onTabChange,\n currentProjectDeals,\n completedProjectDeals,\n manualDeals,\n currentEmptyMessage,\n completedEmptyMessage,\n gatedEmptyState,\n completedYearFilter,\n getCollabMembership,\n getCollabHref,\n getOnCollabClick,\n onEditDeal,\n onDeleteDeal,\n onOpenDocument,\n clientImageUrl,\n resolveImageUrl,\n getProjectDealAsideFooter,\n getManualDealAsideFooter,\n getProjectDealStatusPill,\n } = adapter;\n\n const [previewDeal, setPreviewDeal] = useState<ManualDeal | null>(null);\n\n const resolvedCompletedEmptyMessage =\n typeof completedEmptyMessage === \"function\"\n ? completedEmptyMessage(currentProjectDeals.length > 0)\n : completedEmptyMessage;\n const hasCompletedContent = completedProjectDeals.length > 0 || manualDeals.length > 0;\n\n if (isLoading) {\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n <Skeleton className=\"h-9 w-full rounded-[10px]\" />\n <Skeleton className=\"h-[300px] w-full rounded-[10px]\" />\n </div>\n );\n }\n\n return (\n <div className={className}>\n <Tabs\n value={activeTab}\n onValueChange={(value) => onTabChange(value as \"current\" | \"completed\")}\n className=\"w-full flex flex-col gap-3\"\n >\n <TabsList className=\"grid w-full grid-cols-2 bg-transparent border-b border-greys-grey-strokes-tables rounded-none h-auto p-0\">\n <TabsTrigger\n value=\"current\"\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none\"\n >\n Current Deals\n </TabsTrigger>\n <TabsTrigger\n value=\"completed\"\n disabled={!!gatedEmptyState}\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Completed\n </TabsTrigger>\n </TabsList>\n\n {error ? (\n <div className=\"flex flex-col items-center justify-center gap-3 py-10 px-6\" role=\"alert\">\n <p className=\"body-text text-text-primary text-center\">{errorMessage}</p>\n {onRetry && (\n <Button variant=\"secondary\" size=\"form\" onClick={onRetry}>\n Retry\n </Button>\n )}\n </div>\n ) : (\n <>\n {activeTab === \"completed\" && completedYearFilter && (\n <Select\n value={completedYearFilter.value}\n onValueChange={completedYearFilter.onChange}\n >\n <SelectTrigger className=\"w-[140px]\" aria-label=\"Filter completed deals by year\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {completedYearFilter.options.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n\n <div className=\"hidden sm:flex items-center bg-greys-grey-table-h rounded-t-[10px] py-0 px-3 gap-3 h-[33px]\">\n <span className=\"label-xs-table text-text-primary font-ss02\">Deals</span>\n </div>\n\n <TabsContent value=\"current\" className=\"mt-0\">\n {gatedEmptyState ? (\n gatedEmptyState\n ) : currentProjectDeals.length > 0 ? (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {currentProjectDeals.map((deal) => (\n <ProjectDealCard\n key={deal.project_id}\n deal={deal}\n isCompleted={false}\n collabMembership={getCollabMembership(deal.project_id)}\n collabHref={getCollabHref(deal.project_id)}\n onCollabClick={getOnCollabClick?.(deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(deal)}\n statusPill={getProjectDealStatusPill?.(deal)}\n />\n ))}\n </div>\n ) : (\n <DealEmptyState message={currentEmptyMessage} />\n )}\n </TabsContent>\n\n <TabsContent value=\"completed\" className=\"mt-0\">\n {!hasCompletedContent ? (\n <DealEmptyState message={resolvedCompletedEmptyMessage} />\n ) : (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {completedProjectDeals.map((deal) => (\n <ProjectDealCard\n key={deal.project_id}\n deal={deal}\n isCompleted={true}\n collabMembership={getCollabMembership(deal.project_id)}\n collabHref={getCollabHref(deal.project_id)}\n onCollabClick={getOnCollabClick?.(deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(deal)}\n statusPill={getProjectDealStatusPill?.(deal)}\n />\n ))}\n {manualDeals.map((deal) => (\n <ManualDealCard\n key={deal.id}\n deal={deal}\n onPreview={setPreviewDeal}\n onEdit={onEditDeal}\n onDelete={onDeleteDeal}\n onOpenDocument={onOpenDocument}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getManualDealAsideFooter?.(deal)}\n />\n ))}\n </div>\n )}\n </TabsContent>\n </>\n )}\n </Tabs>\n\n <ManualDealPreviewDialog\n deal={previewDeal}\n open={!!previewDeal}\n onOpenChange={(open) => {\n if (!open) setPreviewDeal(null);\n }}\n onEdit={\n onEditDeal\n ? (deal) => {\n // Close the preview before handing off to the edit flow.\n setPreviewDeal(null);\n onEditDeal(deal);\n }\n : undefined\n }\n onOpenDocument={onOpenDocument}\n clientImageUrl={clientImageUrl}\n resolveImageUrl={resolveImageUrl}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA0D;AAE1D,oBAaO;AAEP,uBASO;AAsGD;AAtCC,SAAS,oBAAoB,EAAE,SAAS,UAAU,GAA6B;AACpF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,CAAC,aAAa,cAAc,QAAI,uBAA4B,IAAI;AAEtE,QAAM,gCACJ,OAAO,0BAA0B,aAC7B,sBAAsB,oBAAoB,SAAS,CAAC,IACpD;AACN,QAAM,sBAAsB,sBAAsB,SAAS,KAAK,YAAY,SAAS;AAErF,MAAI,WAAW;AACb,WACE,6CAAC,SAAI,eAAW,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AM,gBAAe,IAAI;AAAA,QAChC;AAAA,QACA,QACE,aACI,CAAC,SAAS;AAER,yBAAe,IAAI;AACnB,qBAAW,IAAI;AAAA,QACjB,IACA;AAAA,QAEN;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/marketing/index.ts","../src/marketing/marketing-deals-panel.tsx"],"sourcesContent":["export {\n MarketingDealsPanel,\n type MarketingDealsAdapter,\n type MarketingDealsPanelProps,\n} from \"./marketing-deals-panel\";\n","import { useState, type MouseEvent, type ReactNode } from \"react\";\n\nimport {\n Button,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n cn,\n} from \"@nukleus-sports/ui-web\";\nimport { type EntityImageResolver } from \"@nukleus-sports/ui-patterns\";\nimport {\n DealEmptyState,\n ManualDealCard,\n ManualDealPreviewDialog,\n ProjectDealCard,\n type ManualDeal,\n type ManualDealDocumentRef,\n type ProjectCollabMembership,\n type ProjectDeal,\n} from \"@nukleus-sports/ui-patterns/marketing\";\n\n// Reconciled from both apps -- see RECONCILIATION.md#marketing-deals-panel\n\nexport interface MarketingDealsAdapter {\n isLoading?: boolean;\n error?: boolean;\n errorMessage?: string;\n onRetry?: () => void;\n\n activeTab: \"current\" | \"completed\";\n onTabChange: (tab: \"current\" | \"completed\") => void;\n\n currentProjectDeals: ProjectDeal[];\n /** One ordered list so callers control interleaving (e.g. newest-first across both kinds). */\n completedDeals: ({ kind: \"project\"; deal: ProjectDeal } | { kind: \"manual\"; deal: ManualDeal })[];\n\n currentEmptyMessage: string;\n /** Accepts a function because nukleus-app's wording depends on whether current deals exist. */\n completedEmptyMessage: string | ((hasCurrentProjectDeals: boolean) => string);\n\n /** Replaces the Current tab's content and disables the Completed tab (nukleus-app's gating). */\n gatedEmptyState?: ReactNode;\n\n /**\n * `options` must include any \"All\" entry the caller wants — this package renders only the\n * dropdown, not the filtering logic.\n */\n completedYearFilter?: {\n options: { value: string; label: string }[];\n value: string;\n onChange: (value: string) => void;\n };\n\n /** Required because `ProjectDealCard` structurally enforces the collab-membership check. */\n getCollabMembership: (projectId: string) => ProjectCollabMembership;\n getCollabHref: (projectId: string) => string;\n /** nukleus-app's demo-mode upsell toast swaps the collab link for a button here. */\n getOnCollabClick?: (\n projectId: string,\n ) => ((e: MouseEvent<HTMLButtonElement>) => void) | undefined;\n\n onEditDeal?: (deal: ManualDeal) => void;\n onDeleteDeal?: (deal: ManualDeal) => void;\n onOpenDocument: (doc: ManualDealDocumentRef) => void;\n\n /** Shown beside \"Client Name\" in the manual deal preview dialog; omit for no avatar. */\n clientImageUrl?: string | null;\n resolveImageUrl?: EntityImageResolver;\n\n /** Rendered via `asideFooter`; `ManualDealCard` shows it on desktop only (see that component). */\n getProjectDealAsideFooter?: (deal: ProjectDeal) => ReactNode;\n getManualDealAsideFooter?: (deal: ManualDeal) => ReactNode;\n\n /** Overrides the computed Active/Upcoming/Complete status pill -- for a\n * caller whose own saved status has more states dates alone can't express. */\n getProjectDealStatusPill?: (deal: ProjectDeal) => ReactNode;\n}\n\nexport interface MarketingDealsPanelProps {\n adapter: MarketingDealsAdapter;\n className?: string;\n}\n\nexport function MarketingDealsPanel({ adapter, className }: MarketingDealsPanelProps) {\n const {\n isLoading,\n error,\n errorMessage = \"Could not load marketing deals. Please try again.\",\n onRetry,\n activeTab,\n onTabChange,\n currentProjectDeals,\n completedDeals,\n currentEmptyMessage,\n completedEmptyMessage,\n gatedEmptyState,\n completedYearFilter,\n getCollabMembership,\n getCollabHref,\n getOnCollabClick,\n onEditDeal,\n onDeleteDeal,\n onOpenDocument,\n clientImageUrl,\n resolveImageUrl,\n getProjectDealAsideFooter,\n getManualDealAsideFooter,\n getProjectDealStatusPill,\n } = adapter;\n\n const [previewDeal, setPreviewDeal] = useState<ManualDeal | null>(null);\n\n const resolvedCompletedEmptyMessage =\n typeof completedEmptyMessage === \"function\"\n ? completedEmptyMessage(currentProjectDeals.length > 0)\n : completedEmptyMessage;\n const hasCompletedContent = completedDeals.length > 0;\n\n if (isLoading) {\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n <Skeleton className=\"h-9 w-full rounded-[10px]\" />\n <Skeleton className=\"h-[300px] w-full rounded-[10px]\" />\n </div>\n );\n }\n\n return (\n <div className={className}>\n <Tabs\n value={activeTab}\n onValueChange={(value) => onTabChange(value as \"current\" | \"completed\")}\n className=\"w-full flex flex-col gap-3\"\n >\n <TabsList className=\"grid w-full grid-cols-2 bg-transparent border-b border-greys-grey-strokes-tables rounded-none h-auto p-0\">\n <TabsTrigger\n value=\"current\"\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none\"\n >\n Current Deals\n </TabsTrigger>\n <TabsTrigger\n value=\"completed\"\n disabled={!!gatedEmptyState}\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Completed\n </TabsTrigger>\n </TabsList>\n\n {error ? (\n <div className=\"flex flex-col items-center justify-center gap-3 py-10 px-6\" role=\"alert\">\n <p className=\"body-text text-text-primary text-center\">{errorMessage}</p>\n {onRetry && (\n <Button variant=\"secondary\" size=\"form\" onClick={onRetry}>\n Retry\n </Button>\n )}\n </div>\n ) : (\n <>\n {activeTab === \"completed\" && completedYearFilter && (\n <Select\n value={completedYearFilter.value}\n onValueChange={completedYearFilter.onChange}\n >\n <SelectTrigger className=\"w-[140px]\" aria-label=\"Filter completed deals by year\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {completedYearFilter.options.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n\n <div className=\"hidden sm:flex items-center bg-greys-grey-table-h rounded-t-[10px] py-0 px-3 gap-3 h-[33px]\">\n <span className=\"label-xs-table text-text-primary font-ss02\">Deals</span>\n </div>\n\n <TabsContent value=\"current\" className=\"mt-0\">\n {gatedEmptyState ? (\n gatedEmptyState\n ) : currentProjectDeals.length > 0 ? (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {currentProjectDeals.map((deal) => (\n <ProjectDealCard\n key={deal.project_id}\n deal={deal}\n isCompleted={false}\n collabMembership={getCollabMembership(deal.project_id)}\n collabHref={getCollabHref(deal.project_id)}\n onCollabClick={getOnCollabClick?.(deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(deal)}\n statusPill={getProjectDealStatusPill?.(deal)}\n />\n ))}\n </div>\n ) : (\n <DealEmptyState message={currentEmptyMessage} />\n )}\n </TabsContent>\n\n <TabsContent value=\"completed\" className=\"mt-0\">\n {!hasCompletedContent ? (\n <DealEmptyState message={resolvedCompletedEmptyMessage} />\n ) : (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {completedDeals.map((item) =>\n item.kind === \"project\" ? (\n <ProjectDealCard\n key={`project-${item.deal.project_id}`}\n deal={item.deal}\n isCompleted={true}\n collabMembership={getCollabMembership(item.deal.project_id)}\n collabHref={getCollabHref(item.deal.project_id)}\n onCollabClick={getOnCollabClick?.(item.deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(item.deal)}\n statusPill={getProjectDealStatusPill?.(item.deal)}\n />\n ) : (\n <ManualDealCard\n key={`manual-${item.deal.id}`}\n deal={item.deal}\n onPreview={setPreviewDeal}\n onEdit={onEditDeal}\n onDelete={onDeleteDeal}\n onOpenDocument={onOpenDocument}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getManualDealAsideFooter?.(item.deal)}\n />\n ),\n )}\n </div>\n )}\n </TabsContent>\n </>\n )}\n </Tabs>\n\n <ManualDealPreviewDialog\n deal={previewDeal}\n open={!!previewDeal}\n onOpenChange={(open) => {\n if (!open) setPreviewDeal(null);\n }}\n onEdit={\n onEditDeal\n ? (deal) => {\n // Close the preview before handing off to the edit flow.\n setPreviewDeal(null);\n onEditDeal(deal);\n }\n : undefined\n }\n onOpenDocument={onOpenDocument}\n clientImageUrl={clientImageUrl}\n resolveImageUrl={resolveImageUrl}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA0D;AAE1D,oBAaO;AAEP,uBASO;AAqGD;AArCC,SAAS,oBAAoB,EAAE,SAAS,UAAU,GAA6B;AACpF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,CAAC,aAAa,cAAc,QAAI,uBAA4B,IAAI;AAEtE,QAAM,gCACJ,OAAO,0BAA0B,aAC7B,sBAAsB,oBAAoB,SAAS,CAAC,IACpD;AACN,QAAM,sBAAsB,eAAe,SAAS;AAEpD,MAAI,WAAW;AACb,WACE,6CAAC,SAAI,eAAW,kBAAG,uBAAuB,SAAS,GACjD;AAAA,kDAAC,0BAAS,WAAU,6BAA4B;AAAA,MAChD,4CAAC,0BAAS,WAAU,mCAAkC;AAAA,OACxD;AAAA,EAEJ;AAEA,SACE,6CAAC,SAAI,WACH;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP,eAAe,CAAC,UAAU,YAAY,KAAgC;AAAA,QACtE,WAAU;AAAA,QAEV;AAAA,uDAAC,0BAAS,W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cts
CHANGED
|
@@ -11,8 +11,14 @@ interface MarketingDealsAdapter {
|
|
|
11
11
|
activeTab: "current" | "completed";
|
|
12
12
|
onTabChange: (tab: "current" | "completed") => void;
|
|
13
13
|
currentProjectDeals: ProjectDeal[];
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/** One ordered list so callers control interleaving (e.g. newest-first across both kinds). */
|
|
15
|
+
completedDeals: ({
|
|
16
|
+
kind: "project";
|
|
17
|
+
deal: ProjectDeal;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "manual";
|
|
20
|
+
deal: ManualDeal;
|
|
21
|
+
})[];
|
|
16
22
|
currentEmptyMessage: string;
|
|
17
23
|
/** Accepts a function because nukleus-app's wording depends on whether current deals exist. */
|
|
18
24
|
completedEmptyMessage: string | ((hasCurrentProjectDeals: boolean) => string);
|
package/dist/marketing.d.ts
CHANGED
|
@@ -11,8 +11,14 @@ interface MarketingDealsAdapter {
|
|
|
11
11
|
activeTab: "current" | "completed";
|
|
12
12
|
onTabChange: (tab: "current" | "completed") => void;
|
|
13
13
|
currentProjectDeals: ProjectDeal[];
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/** One ordered list so callers control interleaving (e.g. newest-first across both kinds). */
|
|
15
|
+
completedDeals: ({
|
|
16
|
+
kind: "project";
|
|
17
|
+
deal: ProjectDeal;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "manual";
|
|
20
|
+
deal: ManualDeal;
|
|
21
|
+
})[];
|
|
16
22
|
currentEmptyMessage: string;
|
|
17
23
|
/** Accepts a function because nukleus-app's wording depends on whether current deals exist. */
|
|
18
24
|
completedEmptyMessage: string | ((hasCurrentProjectDeals: boolean) => string);
|
package/dist/marketing.js
CHANGED
|
@@ -30,8 +30,7 @@ function MarketingDealsPanel({ adapter, className }) {
|
|
|
30
30
|
activeTab,
|
|
31
31
|
onTabChange,
|
|
32
32
|
currentProjectDeals,
|
|
33
|
-
|
|
34
|
-
manualDeals,
|
|
33
|
+
completedDeals,
|
|
35
34
|
currentEmptyMessage,
|
|
36
35
|
completedEmptyMessage,
|
|
37
36
|
gatedEmptyState,
|
|
@@ -50,7 +49,7 @@ function MarketingDealsPanel({ adapter, className }) {
|
|
|
50
49
|
} = adapter;
|
|
51
50
|
const [previewDeal, setPreviewDeal] = useState(null);
|
|
52
51
|
const resolvedCompletedEmptyMessage = typeof completedEmptyMessage === "function" ? completedEmptyMessage(currentProjectDeals.length > 0) : completedEmptyMessage;
|
|
53
|
-
const hasCompletedContent =
|
|
52
|
+
const hasCompletedContent = completedDeals.length > 0;
|
|
54
53
|
if (isLoading) {
|
|
55
54
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-3", className), children: [
|
|
56
55
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-full rounded-[10px]" }),
|
|
@@ -114,35 +113,34 @@ function MarketingDealsPanel({ adapter, className }) {
|
|
|
114
113
|
},
|
|
115
114
|
deal.project_id
|
|
116
115
|
)) }) : /* @__PURE__ */ jsx(DealEmptyState, { message: currentEmptyMessage }) }),
|
|
117
|
-
/* @__PURE__ */ jsx(TabsContent, { value: "completed", className: "mt-0", children: !hasCompletedContent ? /* @__PURE__ */ jsx(DealEmptyState, { message: resolvedCompletedEmptyMessage }) : /* @__PURE__ */
|
|
118
|
-
|
|
116
|
+
/* @__PURE__ */ jsx(TabsContent, { value: "completed", className: "mt-0", children: !hasCompletedContent ? /* @__PURE__ */ jsx(DealEmptyState, { message: resolvedCompletedEmptyMessage }) : /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3 sm:gap-0", children: completedDeals.map(
|
|
117
|
+
(item) => item.kind === "project" ? /* @__PURE__ */ jsx(
|
|
119
118
|
ProjectDealCard,
|
|
120
119
|
{
|
|
121
|
-
deal,
|
|
120
|
+
deal: item.deal,
|
|
122
121
|
isCompleted: true,
|
|
123
|
-
collabMembership: getCollabMembership(deal.project_id),
|
|
124
|
-
collabHref: getCollabHref(deal.project_id),
|
|
125
|
-
onCollabClick: getOnCollabClick?.(deal.project_id),
|
|
122
|
+
collabMembership: getCollabMembership(item.deal.project_id),
|
|
123
|
+
collabHref: getCollabHref(item.deal.project_id),
|
|
124
|
+
onCollabClick: getOnCollabClick?.(item.deal.project_id),
|
|
126
125
|
resolveImageUrl,
|
|
127
|
-
asideFooter: getProjectDealAsideFooter?.(deal),
|
|
128
|
-
statusPill: getProjectDealStatusPill?.(deal)
|
|
126
|
+
asideFooter: getProjectDealAsideFooter?.(item.deal),
|
|
127
|
+
statusPill: getProjectDealStatusPill?.(item.deal)
|
|
129
128
|
},
|
|
130
|
-
deal.project_id
|
|
131
|
-
)
|
|
132
|
-
manualDeals.map((deal) => /* @__PURE__ */ jsx(
|
|
129
|
+
`project-${item.deal.project_id}`
|
|
130
|
+
) : /* @__PURE__ */ jsx(
|
|
133
131
|
ManualDealCard,
|
|
134
132
|
{
|
|
135
|
-
deal,
|
|
133
|
+
deal: item.deal,
|
|
136
134
|
onPreview: setPreviewDeal,
|
|
137
135
|
onEdit: onEditDeal,
|
|
138
136
|
onDelete: onDeleteDeal,
|
|
139
137
|
onOpenDocument,
|
|
140
138
|
resolveImageUrl,
|
|
141
|
-
asideFooter: getManualDealAsideFooter?.(deal)
|
|
139
|
+
asideFooter: getManualDealAsideFooter?.(item.deal)
|
|
142
140
|
},
|
|
143
|
-
deal.id
|
|
144
|
-
)
|
|
145
|
-
|
|
141
|
+
`manual-${item.deal.id}`
|
|
142
|
+
)
|
|
143
|
+
) }) })
|
|
146
144
|
] })
|
|
147
145
|
]
|
|
148
146
|
}
|
package/dist/marketing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marketing/marketing-deals-panel.tsx"],"sourcesContent":["import { useState, type MouseEvent, type ReactNode } from \"react\";\n\nimport {\n Button,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n cn,\n} from \"@nukleus-sports/ui-web\";\nimport { type EntityImageResolver } from \"@nukleus-sports/ui-patterns\";\nimport {\n DealEmptyState,\n ManualDealCard,\n ManualDealPreviewDialog,\n ProjectDealCard,\n type ManualDeal,\n type ManualDealDocumentRef,\n type ProjectCollabMembership,\n type ProjectDeal,\n} from \"@nukleus-sports/ui-patterns/marketing\";\n\n// Reconciled from both apps -- see RECONCILIATION.md#marketing-deals-panel\n\nexport interface MarketingDealsAdapter {\n isLoading?: boolean;\n error?: boolean;\n errorMessage?: string;\n onRetry?: () => void;\n\n activeTab: \"current\" | \"completed\";\n onTabChange: (tab: \"current\" | \"completed\") => void;\n\n currentProjectDeals: ProjectDeal[];\n completedProjectDeals: ProjectDeal[];\n manualDeals: ManualDeal[];\n\n currentEmptyMessage: string;\n /** Accepts a function because nukleus-app's wording depends on whether current deals exist. */\n completedEmptyMessage: string | ((hasCurrentProjectDeals: boolean) => string);\n\n /** Replaces the Current tab's content and disables the Completed tab (nukleus-app's gating). */\n gatedEmptyState?: ReactNode;\n\n /**\n * `options` must include any \"All\" entry the caller wants — this package renders only the\n * dropdown, not the filtering logic.\n */\n completedYearFilter?: {\n options: { value: string; label: string }[];\n value: string;\n onChange: (value: string) => void;\n };\n\n /** Required because `ProjectDealCard` structurally enforces the collab-membership check. */\n getCollabMembership: (projectId: string) => ProjectCollabMembership;\n getCollabHref: (projectId: string) => string;\n /** nukleus-app's demo-mode upsell toast swaps the collab link for a button here. */\n getOnCollabClick?: (\n projectId: string,\n ) => ((e: MouseEvent<HTMLButtonElement>) => void) | undefined;\n\n onEditDeal?: (deal: ManualDeal) => void;\n onDeleteDeal?: (deal: ManualDeal) => void;\n onOpenDocument: (doc: ManualDealDocumentRef) => void;\n\n /** Shown beside \"Client Name\" in the manual deal preview dialog; omit for no avatar. */\n clientImageUrl?: string | null;\n resolveImageUrl?: EntityImageResolver;\n\n /** Rendered via `asideFooter`; `ManualDealCard` shows it on desktop only (see that component). */\n getProjectDealAsideFooter?: (deal: ProjectDeal) => ReactNode;\n getManualDealAsideFooter?: (deal: ManualDeal) => ReactNode;\n\n /** Overrides the computed Active/Upcoming/Complete status pill -- for a\n * caller whose own saved status has more states dates alone can't express. */\n getProjectDealStatusPill?: (deal: ProjectDeal) => ReactNode;\n}\n\nexport interface MarketingDealsPanelProps {\n adapter: MarketingDealsAdapter;\n className?: string;\n}\n\nexport function MarketingDealsPanel({ adapter, className }: MarketingDealsPanelProps) {\n const {\n isLoading,\n error,\n errorMessage = \"Could not load marketing deals. Please try again.\",\n onRetry,\n activeTab,\n onTabChange,\n currentProjectDeals,\n completedProjectDeals,\n manualDeals,\n currentEmptyMessage,\n completedEmptyMessage,\n gatedEmptyState,\n completedYearFilter,\n getCollabMembership,\n getCollabHref,\n getOnCollabClick,\n onEditDeal,\n onDeleteDeal,\n onOpenDocument,\n clientImageUrl,\n resolveImageUrl,\n getProjectDealAsideFooter,\n getManualDealAsideFooter,\n getProjectDealStatusPill,\n } = adapter;\n\n const [previewDeal, setPreviewDeal] = useState<ManualDeal | null>(null);\n\n const resolvedCompletedEmptyMessage =\n typeof completedEmptyMessage === \"function\"\n ? completedEmptyMessage(currentProjectDeals.length > 0)\n : completedEmptyMessage;\n const hasCompletedContent = completedProjectDeals.length > 0 || manualDeals.length > 0;\n\n if (isLoading) {\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n <Skeleton className=\"h-9 w-full rounded-[10px]\" />\n <Skeleton className=\"h-[300px] w-full rounded-[10px]\" />\n </div>\n );\n }\n\n return (\n <div className={className}>\n <Tabs\n value={activeTab}\n onValueChange={(value) => onTabChange(value as \"current\" | \"completed\")}\n className=\"w-full flex flex-col gap-3\"\n >\n <TabsList className=\"grid w-full grid-cols-2 bg-transparent border-b border-greys-grey-strokes-tables rounded-none h-auto p-0\">\n <TabsTrigger\n value=\"current\"\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none\"\n >\n Current Deals\n </TabsTrigger>\n <TabsTrigger\n value=\"completed\"\n disabled={!!gatedEmptyState}\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Completed\n </TabsTrigger>\n </TabsList>\n\n {error ? (\n <div className=\"flex flex-col items-center justify-center gap-3 py-10 px-6\" role=\"alert\">\n <p className=\"body-text text-text-primary text-center\">{errorMessage}</p>\n {onRetry && (\n <Button variant=\"secondary\" size=\"form\" onClick={onRetry}>\n Retry\n </Button>\n )}\n </div>\n ) : (\n <>\n {activeTab === \"completed\" && completedYearFilter && (\n <Select\n value={completedYearFilter.value}\n onValueChange={completedYearFilter.onChange}\n >\n <SelectTrigger className=\"w-[140px]\" aria-label=\"Filter completed deals by year\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {completedYearFilter.options.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n\n <div className=\"hidden sm:flex items-center bg-greys-grey-table-h rounded-t-[10px] py-0 px-3 gap-3 h-[33px]\">\n <span className=\"label-xs-table text-text-primary font-ss02\">Deals</span>\n </div>\n\n <TabsContent value=\"current\" className=\"mt-0\">\n {gatedEmptyState ? (\n gatedEmptyState\n ) : currentProjectDeals.length > 0 ? (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {currentProjectDeals.map((deal) => (\n <ProjectDealCard\n key={deal.project_id}\n deal={deal}\n isCompleted={false}\n collabMembership={getCollabMembership(deal.project_id)}\n collabHref={getCollabHref(deal.project_id)}\n onCollabClick={getOnCollabClick?.(deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(deal)}\n statusPill={getProjectDealStatusPill?.(deal)}\n />\n ))}\n </div>\n ) : (\n <DealEmptyState message={currentEmptyMessage} />\n )}\n </TabsContent>\n\n <TabsContent value=\"completed\" className=\"mt-0\">\n {!hasCompletedContent ? (\n <DealEmptyState message={resolvedCompletedEmptyMessage} />\n ) : (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {completedProjectDeals.map((deal) => (\n <ProjectDealCard\n key={deal.project_id}\n deal={deal}\n isCompleted={true}\n collabMembership={getCollabMembership(deal.project_id)}\n collabHref={getCollabHref(deal.project_id)}\n onCollabClick={getOnCollabClick?.(deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(deal)}\n statusPill={getProjectDealStatusPill?.(deal)}\n />\n ))}\n {manualDeals.map((deal) => (\n <ManualDealCard\n key={deal.id}\n deal={deal}\n onPreview={setPreviewDeal}\n onEdit={onEditDeal}\n onDelete={onDeleteDeal}\n onOpenDocument={onOpenDocument}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getManualDealAsideFooter?.(deal)}\n />\n ))}\n </div>\n )}\n </TabsContent>\n </>\n )}\n </Tabs>\n\n <ManualDealPreviewDialog\n deal={previewDeal}\n open={!!previewDeal}\n onOpenChange={(open) => {\n if (!open) setPreviewDeal(null);\n }}\n onEdit={\n onEditDeal\n ? (deal) => {\n // Close the preview before handing off to the edit flow.\n setPreviewDeal(null);\n onEditDeal(deal);\n }\n : undefined\n }\n onOpenDocument={onOpenDocument}\n clientImageUrl={clientImageUrl}\n resolveImageUrl={resolveImageUrl}\n />\n </div>\n );\n}\n"],"mappings":";AAAA,SAAS,gBAAiD;AAE1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAsGD,SAwCI,UAvCF,KADF;AAtCC,SAAS,oBAAoB,EAAE,SAAS,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AAA,kBACjD;AAAA,kBACA,aAAa,4BAA4B,IAAI;AAAA,kBAC7C,YAAY,2BAA2B,IAAI;AAAA;AAAA,gBARtC,KAAK;AAAA,cASZ,CACD;AAAA,cACA,YAAY,IAAI,CAAC,SAChB;AAAA,gBAAC;AAAA;AAAA,kBAEC;AAAA,kBACA,WAAW;AAAA,kBACX,QAAQ;AAAA,kBACR,UAAU;AAAA,kBACV;AAAA,kBACA;AAAA,kBACA,aAAa,2BAA2B,IAAI;AAAA;AAAA,gBAPvC,KAAK;AAAA,cAQZ,CACD;AAAA,eACH,GAEJ;AAAA,aACF;AAAA;AAAA;AAAA,IAEJ;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,MAAM,CAAC,CAAC;AAAA,QACR,cAAc,CAAC,SAAS;AACtB,cAAI,CAAC,KAAM,gBAAe,IAAI;AAAA,QAChC;AAAA,QACA,QACE,aACI,CAAC,SAAS;AAER,yBAAe,IAAI;AACnB,qBAAW,IAAI;AAAA,QACjB,IACA;AAAA,QAEN;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/marketing/marketing-deals-panel.tsx"],"sourcesContent":["import { useState, type MouseEvent, type ReactNode } from \"react\";\n\nimport {\n Button,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n cn,\n} from \"@nukleus-sports/ui-web\";\nimport { type EntityImageResolver } from \"@nukleus-sports/ui-patterns\";\nimport {\n DealEmptyState,\n ManualDealCard,\n ManualDealPreviewDialog,\n ProjectDealCard,\n type ManualDeal,\n type ManualDealDocumentRef,\n type ProjectCollabMembership,\n type ProjectDeal,\n} from \"@nukleus-sports/ui-patterns/marketing\";\n\n// Reconciled from both apps -- see RECONCILIATION.md#marketing-deals-panel\n\nexport interface MarketingDealsAdapter {\n isLoading?: boolean;\n error?: boolean;\n errorMessage?: string;\n onRetry?: () => void;\n\n activeTab: \"current\" | \"completed\";\n onTabChange: (tab: \"current\" | \"completed\") => void;\n\n currentProjectDeals: ProjectDeal[];\n /** One ordered list so callers control interleaving (e.g. newest-first across both kinds). */\n completedDeals: ({ kind: \"project\"; deal: ProjectDeal } | { kind: \"manual\"; deal: ManualDeal })[];\n\n currentEmptyMessage: string;\n /** Accepts a function because nukleus-app's wording depends on whether current deals exist. */\n completedEmptyMessage: string | ((hasCurrentProjectDeals: boolean) => string);\n\n /** Replaces the Current tab's content and disables the Completed tab (nukleus-app's gating). */\n gatedEmptyState?: ReactNode;\n\n /**\n * `options` must include any \"All\" entry the caller wants — this package renders only the\n * dropdown, not the filtering logic.\n */\n completedYearFilter?: {\n options: { value: string; label: string }[];\n value: string;\n onChange: (value: string) => void;\n };\n\n /** Required because `ProjectDealCard` structurally enforces the collab-membership check. */\n getCollabMembership: (projectId: string) => ProjectCollabMembership;\n getCollabHref: (projectId: string) => string;\n /** nukleus-app's demo-mode upsell toast swaps the collab link for a button here. */\n getOnCollabClick?: (\n projectId: string,\n ) => ((e: MouseEvent<HTMLButtonElement>) => void) | undefined;\n\n onEditDeal?: (deal: ManualDeal) => void;\n onDeleteDeal?: (deal: ManualDeal) => void;\n onOpenDocument: (doc: ManualDealDocumentRef) => void;\n\n /** Shown beside \"Client Name\" in the manual deal preview dialog; omit for no avatar. */\n clientImageUrl?: string | null;\n resolveImageUrl?: EntityImageResolver;\n\n /** Rendered via `asideFooter`; `ManualDealCard` shows it on desktop only (see that component). */\n getProjectDealAsideFooter?: (deal: ProjectDeal) => ReactNode;\n getManualDealAsideFooter?: (deal: ManualDeal) => ReactNode;\n\n /** Overrides the computed Active/Upcoming/Complete status pill -- for a\n * caller whose own saved status has more states dates alone can't express. */\n getProjectDealStatusPill?: (deal: ProjectDeal) => ReactNode;\n}\n\nexport interface MarketingDealsPanelProps {\n adapter: MarketingDealsAdapter;\n className?: string;\n}\n\nexport function MarketingDealsPanel({ adapter, className }: MarketingDealsPanelProps) {\n const {\n isLoading,\n error,\n errorMessage = \"Could not load marketing deals. Please try again.\",\n onRetry,\n activeTab,\n onTabChange,\n currentProjectDeals,\n completedDeals,\n currentEmptyMessage,\n completedEmptyMessage,\n gatedEmptyState,\n completedYearFilter,\n getCollabMembership,\n getCollabHref,\n getOnCollabClick,\n onEditDeal,\n onDeleteDeal,\n onOpenDocument,\n clientImageUrl,\n resolveImageUrl,\n getProjectDealAsideFooter,\n getManualDealAsideFooter,\n getProjectDealStatusPill,\n } = adapter;\n\n const [previewDeal, setPreviewDeal] = useState<ManualDeal | null>(null);\n\n const resolvedCompletedEmptyMessage =\n typeof completedEmptyMessage === \"function\"\n ? completedEmptyMessage(currentProjectDeals.length > 0)\n : completedEmptyMessage;\n const hasCompletedContent = completedDeals.length > 0;\n\n if (isLoading) {\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n <Skeleton className=\"h-9 w-full rounded-[10px]\" />\n <Skeleton className=\"h-[300px] w-full rounded-[10px]\" />\n </div>\n );\n }\n\n return (\n <div className={className}>\n <Tabs\n value={activeTab}\n onValueChange={(value) => onTabChange(value as \"current\" | \"completed\")}\n className=\"w-full flex flex-col gap-3\"\n >\n <TabsList className=\"grid w-full grid-cols-2 bg-transparent border-b border-greys-grey-strokes-tables rounded-none h-auto p-0\">\n <TabsTrigger\n value=\"current\"\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none\"\n >\n Current Deals\n </TabsTrigger>\n <TabsTrigger\n value=\"completed\"\n disabled={!!gatedEmptyState}\n className=\"py-2.5 px-2 rounded-none border-b-2 border-transparent text-text-primary data-[state=active]:text-primary-color-nuk-text data-[state=active]:border-primary-color-nuk-text data-[state=active]:bg-transparent data-[state=active]:shadow-none disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Completed\n </TabsTrigger>\n </TabsList>\n\n {error ? (\n <div className=\"flex flex-col items-center justify-center gap-3 py-10 px-6\" role=\"alert\">\n <p className=\"body-text text-text-primary text-center\">{errorMessage}</p>\n {onRetry && (\n <Button variant=\"secondary\" size=\"form\" onClick={onRetry}>\n Retry\n </Button>\n )}\n </div>\n ) : (\n <>\n {activeTab === \"completed\" && completedYearFilter && (\n <Select\n value={completedYearFilter.value}\n onValueChange={completedYearFilter.onChange}\n >\n <SelectTrigger className=\"w-[140px]\" aria-label=\"Filter completed deals by year\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {completedYearFilter.options.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n\n <div className=\"hidden sm:flex items-center bg-greys-grey-table-h rounded-t-[10px] py-0 px-3 gap-3 h-[33px]\">\n <span className=\"label-xs-table text-text-primary font-ss02\">Deals</span>\n </div>\n\n <TabsContent value=\"current\" className=\"mt-0\">\n {gatedEmptyState ? (\n gatedEmptyState\n ) : currentProjectDeals.length > 0 ? (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {currentProjectDeals.map((deal) => (\n <ProjectDealCard\n key={deal.project_id}\n deal={deal}\n isCompleted={false}\n collabMembership={getCollabMembership(deal.project_id)}\n collabHref={getCollabHref(deal.project_id)}\n onCollabClick={getOnCollabClick?.(deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(deal)}\n statusPill={getProjectDealStatusPill?.(deal)}\n />\n ))}\n </div>\n ) : (\n <DealEmptyState message={currentEmptyMessage} />\n )}\n </TabsContent>\n\n <TabsContent value=\"completed\" className=\"mt-0\">\n {!hasCompletedContent ? (\n <DealEmptyState message={resolvedCompletedEmptyMessage} />\n ) : (\n <div className=\"flex flex-col gap-3 sm:gap-0\">\n {completedDeals.map((item) =>\n item.kind === \"project\" ? (\n <ProjectDealCard\n key={`project-${item.deal.project_id}`}\n deal={item.deal}\n isCompleted={true}\n collabMembership={getCollabMembership(item.deal.project_id)}\n collabHref={getCollabHref(item.deal.project_id)}\n onCollabClick={getOnCollabClick?.(item.deal.project_id)}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getProjectDealAsideFooter?.(item.deal)}\n statusPill={getProjectDealStatusPill?.(item.deal)}\n />\n ) : (\n <ManualDealCard\n key={`manual-${item.deal.id}`}\n deal={item.deal}\n onPreview={setPreviewDeal}\n onEdit={onEditDeal}\n onDelete={onDeleteDeal}\n onOpenDocument={onOpenDocument}\n resolveImageUrl={resolveImageUrl}\n asideFooter={getManualDealAsideFooter?.(item.deal)}\n />\n ),\n )}\n </div>\n )}\n </TabsContent>\n </>\n )}\n </Tabs>\n\n <ManualDealPreviewDialog\n deal={previewDeal}\n open={!!previewDeal}\n onOpenChange={(open) => {\n if (!open) setPreviewDeal(null);\n }}\n onEdit={\n onEditDeal\n ? (deal) => {\n // Close the preview before handing off to the edit flow.\n setPreviewDeal(null);\n onEditDeal(deal);\n }\n : undefined\n }\n onOpenDocument={onOpenDocument}\n clientImageUrl={clientImageUrl}\n resolveImageUrl={resolveImageUrl}\n />\n </div>\n );\n}\n"],"mappings":";AAAA,SAAS,gBAAiD;AAE1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAqGD,SAwCI,UAvCF,KADF;AArCC,SAAS,oBAAoB,EAAE,SAAS,UAAU,GAA6B;AACpF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;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