@naniteninja/dashboard-components-lib 2.4.3 → 2.4.4

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.
@@ -8701,7 +8701,34 @@ function extractShortName(address) {
8701
8701
  const short = parts[0].trim();
8702
8702
  return short.length > 20 ? `${short.slice(0, 20)}...` : short;
8703
8703
  }
8704
+ /**
8705
+ * What to show the matcher once the prospect has taken up something the matcher offered.
8706
+ *
8707
+ * The two routes leave the same shape behind — an accepted location and time — so the
8708
+ * status fields alone cannot say who agreed to what. Read as though it were the other
8709
+ * route, this one announced "Client has ACCEPTED …", which is the wrong party: on this
8710
+ * route the client was told, not asked, and it is the prospect who accepted.
8711
+ */
8712
+ function buildMatcherProposedText(s) {
8713
+ const lines = [];
8714
+ const loc = s.location?.trim() || '';
8715
+ const timeParts = [s.time, s.day, s.date].filter((v) => v && v !== 'unknown').join(', ');
8716
+ if (loc && (s.locationStatus === 'accepted' || s.locationStatus === 'auto_accepted')) {
8717
+ lines.push(`Prospect ACCEPTED your location: ${loc}`);
8718
+ }
8719
+ if (timeParts && s.timeStatus === 'accepted') {
8720
+ lines.push(`Prospect ACCEPTED your time: ${timeParts}`);
8721
+ }
8722
+ // Marked as the matcher's but nothing agreed yet — the offer is still with the prospect.
8723
+ if (lines.length === 0) {
8724
+ return 'Awaiting the prospect on your suggestion';
8725
+ }
8726
+ return lines.join(' | ');
8727
+ }
8704
8728
  function buildSplitSuggestionText(s) {
8729
+ // The matcher-proposed route has its own wording and shares none of the logic below.
8730
+ if (s.proposedBy === 'matcher')
8731
+ return buildMatcherProposedText(s);
8705
8732
  const lines = [];
8706
8733
  const locStatus = s.locationStatus;
8707
8734
  const timeStatus = s.timeStatus;