@baack-software/baack-ts-crm 0.0.0-stage → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +74 -2
  3. package/dist/account.d.ts +36 -0
  4. package/dist/account.d.ts.map +1 -0
  5. package/dist/account.js +48 -0
  6. package/dist/account.js.map +1 -0
  7. package/dist/backend.d.ts +76 -0
  8. package/dist/backend.d.ts.map +1 -0
  9. package/dist/backend.js +233 -0
  10. package/dist/backend.js.map +1 -0
  11. package/dist/crm-client.d.ts +122 -0
  12. package/dist/crm-client.d.ts.map +1 -0
  13. package/dist/crm-client.js +168 -0
  14. package/dist/crm-client.js.map +1 -0
  15. package/dist/errors.d.ts +21 -0
  16. package/dist/errors.d.ts.map +1 -0
  17. package/dist/errors.js +33 -0
  18. package/dist/errors.js.map +1 -0
  19. package/dist/index.d.ts +13 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +13 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/invoices.d.ts +46 -0
  24. package/dist/invoices.d.ts.map +1 -0
  25. package/dist/invoices.js +137 -0
  26. package/dist/invoices.js.map +1 -0
  27. package/dist/leads.d.ts +29 -0
  28. package/dist/leads.d.ts.map +1 -0
  29. package/dist/leads.js +56 -0
  30. package/dist/leads.js.map +1 -0
  31. package/dist/mock/index.d.ts +43 -0
  32. package/dist/mock/index.d.ts.map +1 -0
  33. package/dist/mock/index.js +303 -0
  34. package/dist/mock/index.js.map +1 -0
  35. package/dist/money.d.ts +29 -0
  36. package/dist/money.d.ts.map +1 -0
  37. package/dist/money.js +82 -0
  38. package/dist/money.js.map +1 -0
  39. package/dist/period.d.ts +17 -0
  40. package/dist/period.d.ts.map +1 -0
  41. package/dist/period.js +23 -0
  42. package/dist/period.js.map +1 -0
  43. package/dist/pipeline.d.ts +30 -0
  44. package/dist/pipeline.d.ts.map +1 -0
  45. package/dist/pipeline.js +40 -0
  46. package/dist/pipeline.js.map +1 -0
  47. package/dist/react/Charts.d.ts +19 -0
  48. package/dist/react/Charts.d.ts.map +1 -0
  49. package/dist/react/Charts.js +38 -0
  50. package/dist/react/Charts.js.map +1 -0
  51. package/dist/react/CompanyAccountView.d.ts +21 -0
  52. package/dist/react/CompanyAccountView.d.ts.map +1 -0
  53. package/dist/react/CompanyAccountView.js +27 -0
  54. package/dist/react/CompanyAccountView.js.map +1 -0
  55. package/dist/react/DashboardCards.d.ts +32 -0
  56. package/dist/react/DashboardCards.d.ts.map +1 -0
  57. package/dist/react/DashboardCards.js +38 -0
  58. package/dist/react/DashboardCards.js.map +1 -0
  59. package/dist/react/DealsBoard.d.ts +30 -0
  60. package/dist/react/DealsBoard.d.ts.map +1 -0
  61. package/dist/react/DealsBoard.js +33 -0
  62. package/dist/react/DealsBoard.js.map +1 -0
  63. package/dist/react/Details.d.ts +52 -0
  64. package/dist/react/Details.d.ts.map +1 -0
  65. package/dist/react/Details.js +111 -0
  66. package/dist/react/Details.js.map +1 -0
  67. package/dist/react/Forms.d.ts +59 -0
  68. package/dist/react/Forms.d.ts.map +1 -0
  69. package/dist/react/Forms.js +204 -0
  70. package/dist/react/Forms.js.map +1 -0
  71. package/dist/react/LeadsTable.d.ts +22 -0
  72. package/dist/react/LeadsTable.d.ts.map +1 -0
  73. package/dist/react/LeadsTable.js +79 -0
  74. package/dist/react/LeadsTable.js.map +1 -0
  75. package/dist/react/Sales.d.ts +49 -0
  76. package/dist/react/Sales.d.ts.map +1 -0
  77. package/dist/react/Sales.js +186 -0
  78. package/dist/react/Sales.js.map +1 -0
  79. package/dist/react/SidePanel.d.ts +21 -0
  80. package/dist/react/SidePanel.d.ts.map +1 -0
  81. package/dist/react/SidePanel.js +37 -0
  82. package/dist/react/SidePanel.js.map +1 -0
  83. package/dist/react/format.d.ts +28 -0
  84. package/dist/react/format.d.ts.map +1 -0
  85. package/dist/react/format.js +30 -0
  86. package/dist/react/format.js.map +1 -0
  87. package/dist/react/index.d.ts +14 -0
  88. package/dist/react/index.d.ts.map +1 -0
  89. package/dist/react/index.js +14 -0
  90. package/dist/react/index.js.map +1 -0
  91. package/dist/react/parts.d.ts +45 -0
  92. package/dist/react/parts.d.ts.map +1 -0
  93. package/dist/react/parts.js +59 -0
  94. package/dist/react/parts.js.map +1 -0
  95. package/dist/react/text.d.ts +145 -0
  96. package/dist/react/text.d.ts.map +1 -0
  97. package/dist/react/text.js +142 -0
  98. package/dist/react/text.js.map +1 -0
  99. package/dist/react/ui/alert.d.ts +11 -0
  100. package/dist/react/ui/alert.d.ts.map +1 -0
  101. package/dist/react/ui/alert.js +29 -0
  102. package/dist/react/ui/alert.js.map +1 -0
  103. package/dist/react/ui/badge.d.ts +10 -0
  104. package/dist/react/ui/badge.d.ts.map +1 -0
  105. package/dist/react/ui/badge.js +26 -0
  106. package/dist/react/ui/badge.js.map +1 -0
  107. package/dist/react/ui/button.d.ts +11 -0
  108. package/dist/react/ui/button.d.ts.map +1 -0
  109. package/dist/react/ui/button.js +37 -0
  110. package/dist/react/ui/button.js.map +1 -0
  111. package/dist/react/ui/card.d.ts +12 -0
  112. package/dist/react/ui/card.d.ts.map +1 -0
  113. package/dist/react/ui/card.js +26 -0
  114. package/dist/react/ui/card.js.map +1 -0
  115. package/dist/react/ui/chart.d.ts +45 -0
  116. package/dist/react/ui/chart.d.ts.map +1 -0
  117. package/dist/react/ui/chart.js +116 -0
  118. package/dist/react/ui/chart.js.map +1 -0
  119. package/dist/react/ui/input.d.ts +4 -0
  120. package/dist/react/ui/input.d.ts.map +1 -0
  121. package/dist/react/ui/input.js +8 -0
  122. package/dist/react/ui/input.js.map +1 -0
  123. package/dist/react/ui/label.d.ts +5 -0
  124. package/dist/react/ui/label.d.ts.map +1 -0
  125. package/dist/react/ui/label.js +10 -0
  126. package/dist/react/ui/label.js.map +1 -0
  127. package/dist/react/ui/progress.d.ts +5 -0
  128. package/dist/react/ui/progress.d.ts.map +1 -0
  129. package/dist/react/ui/progress.js +10 -0
  130. package/dist/react/ui/progress.js.map +1 -0
  131. package/dist/react/ui/select.d.ts +16 -0
  132. package/dist/react/ui/select.d.ts.map +1 -0
  133. package/dist/react/ui/select.js +37 -0
  134. package/dist/react/ui/select.js.map +1 -0
  135. package/dist/react/ui/separator.d.ts +5 -0
  136. package/dist/react/ui/separator.d.ts.map +1 -0
  137. package/dist/react/ui/separator.js +10 -0
  138. package/dist/react/ui/separator.js.map +1 -0
  139. package/dist/react/ui/sheet.d.ts +15 -0
  140. package/dist/react/ui/sheet.d.ts.map +1 -0
  141. package/dist/react/ui/sheet.js +38 -0
  142. package/dist/react/ui/sheet.js.map +1 -0
  143. package/dist/react/ui/skeleton.d.ts +3 -0
  144. package/dist/react/ui/skeleton.d.ts.map +1 -0
  145. package/dist/react/ui/skeleton.js +7 -0
  146. package/dist/react/ui/skeleton.js.map +1 -0
  147. package/dist/react/ui/table.d.ts +11 -0
  148. package/dist/react/ui/table.d.ts.map +1 -0
  149. package/dist/react/ui/table.js +29 -0
  150. package/dist/react/ui/table.js.map +1 -0
  151. package/dist/react/ui/tabs.d.ts +12 -0
  152. package/dist/react/ui/tabs.d.ts.map +1 -0
  153. package/dist/react/ui/tabs.js +31 -0
  154. package/dist/react/ui/tabs.js.map +1 -0
  155. package/dist/react/views.d.ts +60 -0
  156. package/dist/react/views.d.ts.map +1 -0
  157. package/dist/react/views.js +172 -0
  158. package/dist/react/views.js.map +1 -0
  159. package/dist/sales.d.ts +57 -0
  160. package/dist/sales.d.ts.map +1 -0
  161. package/dist/sales.js +64 -0
  162. package/dist/sales.js.map +1 -0
  163. package/dist/store.d.ts +140 -0
  164. package/dist/store.d.ts.map +1 -0
  165. package/dist/store.js +244 -0
  166. package/dist/store.js.map +1 -0
  167. package/dist/target.d.ts +21 -0
  168. package/dist/target.d.ts.map +1 -0
  169. package/dist/target.js +36 -0
  170. package/dist/target.js.map +1 -0
  171. package/dist/types.d.ts +180 -0
  172. package/dist/types.d.ts.map +1 -0
  173. package/dist/types.js +2 -0
  174. package/dist/types.js.map +1 -0
  175. package/package.json +100 -4
  176. package/src/account.ts +79 -0
  177. package/src/backend.ts +371 -0
  178. package/src/crm-client.ts +250 -0
  179. package/src/errors.ts +34 -0
  180. package/src/index.ts +12 -0
  181. package/src/invoices.ts +157 -0
  182. package/src/leads.ts +78 -0
  183. package/src/mock/index.ts +398 -0
  184. package/src/money.ts +104 -0
  185. package/src/period.ts +32 -0
  186. package/src/pipeline.ts +61 -0
  187. package/src/react/Charts.tsx +143 -0
  188. package/src/react/CompanyAccountView.tsx +198 -0
  189. package/src/react/DashboardCards.tsx +171 -0
  190. package/src/react/DealsBoard.tsx +177 -0
  191. package/src/react/Details.tsx +293 -0
  192. package/src/react/Forms.tsx +619 -0
  193. package/src/react/LeadsTable.tsx +234 -0
  194. package/src/react/Sales.tsx +539 -0
  195. package/src/react/SidePanel.tsx +95 -0
  196. package/src/react/format.ts +53 -0
  197. package/src/react/index.ts +13 -0
  198. package/src/react/parts.tsx +131 -0
  199. package/src/react/text.ts +144 -0
  200. package/src/react/ui/README.md +6 -0
  201. package/src/react/ui/alert.tsx +75 -0
  202. package/src/react/ui/badge.tsx +48 -0
  203. package/src/react/ui/button.tsx +66 -0
  204. package/src/react/ui/card.tsx +102 -0
  205. package/src/react/ui/chart.tsx +304 -0
  206. package/src/react/ui/input.tsx +18 -0
  207. package/src/react/ui/label.tsx +23 -0
  208. package/src/react/ui/progress.tsx +30 -0
  209. package/src/react/ui/select.tsx +189 -0
  210. package/src/react/ui/separator.tsx +27 -0
  211. package/src/react/ui/sheet.tsx +145 -0
  212. package/src/react/ui/skeleton.tsx +13 -0
  213. package/src/react/ui/table.tsx +113 -0
  214. package/src/react/ui/tabs.tsx +89 -0
  215. package/src/react/views.tsx +443 -0
  216. package/src/sales.ts +120 -0
  217. package/src/store.ts +419 -0
  218. package/src/target.ts +51 -0
  219. package/src/types.ts +202 -0
@@ -0,0 +1,293 @@
1
+ import { useId, useState, type FormEvent, type ReactNode } from 'react';
2
+ import { SOURCE_LABELS, leadOutcome } from '../leads.ts';
3
+ import { dealOutcome, dealProbability, orderedStages, stageOf } from '../pipeline.ts';
4
+ import type { Deal, DealOutcome, Lead, Pipeline, PipelineStage } from '../types.ts';
5
+ import { StageSelect } from './DealsBoard.tsx';
6
+ import { companyNameOf, formatDate, formatMaybeMoney, personNameOf, type CrmNames } from './format.ts';
7
+ import { leadCompany } from './LeadsTable.tsx';
8
+ import { CrmCard, LeadStatusBadge, OutcomeBadge } from './parts.tsx';
9
+ import { withText, type CrmText } from './text.ts';
10
+ import { Button } from './ui/button.tsx';
11
+ import { Input } from './ui/input.tsx';
12
+ import { Label } from './ui/label.tsx';
13
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select.tsx';
14
+
15
+ /** Label and value pairs as a description list. */
16
+ export function DetailList({ items }: { items: { label: string; value: ReactNode }[] }) {
17
+ return (
18
+ <dl className="grid grid-cols-[minmax(7rem,auto)_minmax(0,1fr)] gap-x-4 gap-y-2 text-sm">
19
+ {items.map(({ label, value }) => (
20
+ <div key={label} className="contents">
21
+ <dt className="text-muted-foreground">{label}</dt>
22
+ <dd>{value}</dd>
23
+ </div>
24
+ ))}
25
+ </dl>
26
+ );
27
+ }
28
+
29
+ /** What converting a lead was asked to do: the company name confirmed or corrected, when the lead had no company. */
30
+ export interface ConvertChoice {
31
+ companyName?: string;
32
+ }
33
+
34
+ /**
35
+ * A lead's details. While it's open: "Convert to deal", where the new client company's name can be corrected, and
36
+ * "Mark unqualified" with why. Once unqualified it can be reopened.
37
+ */
38
+ export function LeadDetail({
39
+ lead,
40
+ names,
41
+ onConvert,
42
+ onSetOutcome,
43
+ converting,
44
+ sample,
45
+ text,
46
+ }: {
47
+ lead: Lead;
48
+ names?: CrmNames | undefined;
49
+ /** Shown while the lead is open. */
50
+ onConvert?: ((lead: Lead, choice: ConvertChoice) => void) | undefined;
51
+ /** Unqualifies (with why) or reopens the lead. */
52
+ onSetOutcome?: ((lead: Lead, outcome: 'IN_PROGRESS' | 'CLOSED', closedReason?: string) => void) | undefined;
53
+ converting?: boolean | undefined;
54
+ sample?: boolean | undefined;
55
+ text?: Partial<CrmText> | undefined;
56
+ }) {
57
+ const words = withText(text);
58
+ const id = useId();
59
+ const [companyName, setCompanyName] = useState('');
60
+ const [unqualifying, setUnqualifying] = useState(false);
61
+ const [reason, setReason] = useState('');
62
+ const outcome = leadOutcome(lead);
63
+ const open = outcome === 'IN_PROGRESS';
64
+ const submit = (event: FormEvent) => {
65
+ event.preventDefault();
66
+ onConvert?.(lead, lead.contactCompany ? {} : { companyName: companyName.trim() });
67
+ };
68
+ return (
69
+ <CrmCard title={lead.title} sample={sample} text={text}>
70
+ <div className="grid gap-5">
71
+ <DetailList
72
+ items={[
73
+ { label: words.status, value: <LeadStatusBadge lead={lead} /> },
74
+ // A lead has no close time of its own: it was last changed when it closed.
75
+ ...(!open ? [{ label: words.closed, value: formatDate(lead.updatedTimestamp) }] : []),
76
+ ...(lead.closedReason ? [{ label: words.unqualifiedReason, value: lead.closedReason }] : []),
77
+ { label: words.contact, value: personNameOf(names, lead.contactIdentity?.urn) ?? '-' },
78
+ { label: words.company, value: leadCompany(lead, names) || '-' },
79
+ { label: words.source, value: SOURCE_LABELS[lead.source] },
80
+ { label: words.value, value: formatMaybeMoney(lead.targetValue) },
81
+ { label: words.assignee, value: personNameOf(names, lead.assignee?.urn) ?? '-' },
82
+ { label: words.created, value: formatDate(lead.createdTimestamp) },
83
+ ]}
84
+ />
85
+ {open && onConvert && (
86
+ <form onSubmit={submit} className="grid gap-3" aria-labelledby={`${id}-title`}>
87
+ <div className="grid gap-1">
88
+ <h3 id={`${id}-title`} className="text-sm font-semibold">
89
+ {words.convert}
90
+ </h3>
91
+ <p className="text-muted-foreground text-sm">{words.convertSummary}</p>
92
+ </div>
93
+ {!lead.contactCompany && (
94
+ <div className="grid gap-1.5">
95
+ <Label htmlFor={`${id}-company`}>{words.companyName}</Label>
96
+ <Input
97
+ id={`${id}-company`}
98
+ value={companyName}
99
+ onChange={(event) => setCompanyName(event.target.value)}
100
+ aria-describedby={`${id}-company-hint`}
101
+ />
102
+ <p id={`${id}-company-hint`} className="text-muted-foreground text-xs">
103
+ {words.companyNameHint}
104
+ </p>
105
+ </div>
106
+ )}
107
+ <div>
108
+ <Button type="submit" size="sm" disabled={converting ?? false}>
109
+ {converting ? words.converting : words.convert}
110
+ </Button>
111
+ </div>
112
+ </form>
113
+ )}
114
+ {open && onSetOutcome && !unqualifying && (
115
+ <div>
116
+ <Button type="button" size="sm" variant="outline" onClick={() => setUnqualifying(true)}>
117
+ {words.markUnqualified}
118
+ </Button>
119
+ </div>
120
+ )}
121
+ {open && onSetOutcome && unqualifying && (
122
+ <form
123
+ className="grid gap-2"
124
+ onSubmit={(event) => {
125
+ event.preventDefault();
126
+ setUnqualifying(false);
127
+ onSetOutcome(lead, 'CLOSED', reason);
128
+ }}
129
+ >
130
+ <Label htmlFor={`${id}-reason`}>{words.unqualifiedReason}</Label>
131
+ <Input id={`${id}-reason`} value={reason} onChange={(event) => setReason(event.target.value)} />
132
+ <div className="flex gap-2">
133
+ <Button type="submit" size="sm">
134
+ {words.markUnqualified}
135
+ </Button>
136
+ <Button type="button" size="sm" variant="ghost" onClick={() => setUnqualifying(false)}>
137
+ {words.cancel}
138
+ </Button>
139
+ </div>
140
+ </form>
141
+ )}
142
+ {outcome === 'CLOSED' && onSetOutcome && (
143
+ <div>
144
+ <Button type="button" size="sm" variant="outline" onClick={() => onSetOutcome(lead, 'IN_PROGRESS')}>
145
+ {words.reopen}
146
+ </Button>
147
+ </div>
148
+ )}
149
+ </div>
150
+ </CrmCard>
151
+ );
152
+ }
153
+
154
+ const OUTCOME_LABELS: Record<DealOutcome, keyof CrmText> = {
155
+ OPEN: 'outcomeOpen',
156
+ WON: 'outcomeWon',
157
+ LOST: 'outcomeLost',
158
+ };
159
+
160
+ /**
161
+ * Wins, loses or reopens a deal. Its outcome is on the deal, not its stage, as workflows are only progress. Open and
162
+ * won apply at once; lost asks why first.
163
+ */
164
+ export function OutcomeControl({
165
+ deal,
166
+ onSetOutcome,
167
+ disabled,
168
+ text,
169
+ }: {
170
+ deal: Deal;
171
+ onSetOutcome: (deal: Deal, outcome: DealOutcome, closedReason?: string) => void;
172
+ disabled?: boolean | undefined;
173
+ text?: Partial<CrmText> | undefined;
174
+ }) {
175
+ const words = withText(text);
176
+ const id = useId();
177
+ const [losing, setLosing] = useState(false);
178
+ const [reason, setReason] = useState(deal.lostReason ?? '');
179
+ const outcome = dealOutcome(deal);
180
+ return (
181
+ <div className="grid gap-2">
182
+ <Select
183
+ value={losing ? 'LOST' : outcome}
184
+ disabled={disabled ?? false}
185
+ onValueChange={(value) => {
186
+ if (value === 'LOST') return setLosing(true);
187
+ setLosing(false);
188
+ onSetOutcome(deal, value as DealOutcome);
189
+ }}
190
+ >
191
+ <SelectTrigger size="sm" aria-label={`${words.outcome}: ${deal.title}`}>
192
+ <SelectValue />
193
+ </SelectTrigger>
194
+ <SelectContent>
195
+ {(['OPEN', 'WON', 'LOST'] as const).map((value) => (
196
+ <SelectItem key={value} value={value}>
197
+ {words[OUTCOME_LABELS[value]]}
198
+ </SelectItem>
199
+ ))}
200
+ </SelectContent>
201
+ </Select>
202
+ {losing && (
203
+ <form
204
+ className="grid gap-2"
205
+ onSubmit={(event) => {
206
+ event.preventDefault();
207
+ setLosing(false);
208
+ onSetOutcome(deal, 'LOST', reason);
209
+ }}
210
+ >
211
+ <Label htmlFor={`${id}-reason`}>{words.lostReason}</Label>
212
+ <Input id={`${id}-reason`} value={reason} onChange={(event) => setReason(event.target.value)} />
213
+ <div className="flex gap-2">
214
+ <Button type="submit" size="sm">
215
+ {words.markLost}
216
+ </Button>
217
+ <Button type="button" size="sm" variant="ghost" onClick={() => setLosing(false)}>
218
+ {words.cancel}
219
+ </Button>
220
+ </div>
221
+ </form>
222
+ )}
223
+ </div>
224
+ );
225
+ }
226
+
227
+ /** A deal's details, with its stage picker and its outcome (open, won or lost). */
228
+ export function DealDetail({
229
+ deal,
230
+ pipeline,
231
+ names,
232
+ onMove,
233
+ onSetOutcome,
234
+ saving,
235
+ sample,
236
+ text,
237
+ }: {
238
+ deal: Deal;
239
+ pipeline: Pipeline;
240
+ names?: CrmNames | undefined;
241
+ onMove?: ((deal: Deal, stage: PipelineStage) => void) | undefined;
242
+ onSetOutcome?: ((deal: Deal, outcome: DealOutcome, closedReason?: string) => void) | undefined;
243
+ saving?: boolean | undefined;
244
+ sample?: boolean | undefined;
245
+ text?: Partial<CrmText> | undefined;
246
+ }) {
247
+ const words = withText(text);
248
+ const stage = stageOf(deal, pipeline) ?? orderedStages(pipeline)[0];
249
+ const outcome = dealOutcome(deal);
250
+ const probability = dealProbability(deal);
251
+ return (
252
+ <CrmCard title={deal.title} sample={sample} text={text}>
253
+ <DetailList
254
+ items={[
255
+ {
256
+ label: words.stage,
257
+ value: onMove ? (
258
+ <StageSelect deal={deal} pipeline={pipeline} onMove={onMove} disabled={saving} text={text} />
259
+ ) : (
260
+ (stage?.name ?? '-')
261
+ ),
262
+ },
263
+ {
264
+ label: words.outcome,
265
+ value: onSetOutcome ? (
266
+ <OutcomeControl key={deal.urn} deal={deal} onSetOutcome={onSetOutcome} disabled={saving} text={text} />
267
+ ) : (
268
+ <OutcomeBadge outcome={outcome} label={words[OUTCOME_LABELS[outcome]]} />
269
+ ),
270
+ },
271
+ {
272
+ label: words.company,
273
+ value: deal.contactCompanies.map((company) => companyNameOf(names, company.urn) ?? words.unnamed).join(', ') || '-',
274
+ },
275
+ {
276
+ label: words.contact,
277
+ value:
278
+ deal.contactIdentities.map((contact) => personNameOf(names, contact.urn) ?? words.unnamed).join(', ') || '-',
279
+ },
280
+ { label: words.value, value: formatMaybeMoney(deal.targetValue) },
281
+ { label: words.probability, value: probability === undefined ? '-' : `${probability}%` },
282
+ {
283
+ label: deal.closeTimestamp ? words.closed : words.expectedClose,
284
+ value: formatDate(deal.closeTimestamp ?? deal.targetCloseTimestamp),
285
+ },
286
+ ...(deal.lostReason ? [{ label: words.lostReason, value: deal.lostReason }] : []),
287
+ { label: words.assignee, value: personNameOf(names, deal.assignee?.urn) ?? '-' },
288
+ { label: words.created, value: formatDate(deal.createdTimestamp) },
289
+ ]}
290
+ />
291
+ </CrmCard>
292
+ );
293
+ }