@burdenoff/microfe-proserviceworld 2026.709.1 → 2026.709.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/index.js +2 -1
- package/dist/node_modules/clsx/dist/clsx.js +1 -1
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +130 -130
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/proserviceworld/ProServiceWorldRoot.js +4 -2
- package/dist/proserviceworld/ProServiceWorldRoot.js.map +1 -1
- package/dist/proserviceworld/ProServiceWorldRoutes.d.ts.map +1 -1
- package/dist/proserviceworld/ProServiceWorldRoutes.js +95 -42
- package/dist/proserviceworld/ProServiceWorldRoutes.js.map +1 -1
- package/dist/proserviceworld/components/DiscussionThread.js.map +1 -1
- package/dist/proserviceworld/components/FeatureFlaggedPage.d.ts +8 -0
- package/dist/proserviceworld/components/FeatureFlaggedPage.d.ts.map +1 -0
- package/dist/proserviceworld/components/FeatureFlaggedPage.js +17 -0
- package/dist/proserviceworld/components/FeatureFlaggedPage.js.map +1 -0
- package/dist/proserviceworld/components/LoadMore.d.ts +12 -0
- package/dist/proserviceworld/components/LoadMore.d.ts.map +1 -0
- package/dist/proserviceworld/components/LoadMore.js +30 -0
- package/dist/proserviceworld/components/LoadMore.js.map +1 -0
- package/dist/proserviceworld/components/TagPicker.d.ts +11 -0
- package/dist/proserviceworld/components/TagPicker.d.ts.map +1 -0
- package/dist/proserviceworld/components/TagPicker.js +31 -0
- package/dist/proserviceworld/components/TagPicker.js.map +1 -0
- package/dist/proserviceworld/components/ui.js.map +1 -1
- package/dist/proserviceworld/hooks/useAnalytics.js.map +1 -1
- package/dist/proserviceworld/hooks/useEntityComments.js.map +1 -1
- package/dist/proserviceworld/hooks/useFiles.js.map +1 -1
- package/dist/proserviceworld/hooks/usePageViewAnalytics.d.ts +10 -0
- package/dist/proserviceworld/hooks/usePageViewAnalytics.d.ts.map +1 -0
- package/dist/proserviceworld/hooks/usePageViewAnalytics.js +24 -0
- package/dist/proserviceworld/hooks/usePageViewAnalytics.js.map +1 -0
- package/dist/proserviceworld/hooks/useProServiceWorldApi.js +47 -27
- package/dist/proserviceworld/hooks/useProServiceWorldApi.js.map +1 -1
- package/dist/proserviceworld/i18n/index.d.ts +13 -0
- package/dist/proserviceworld/i18n/index.d.ts.map +1 -0
- package/dist/proserviceworld/i18n/index.js +171 -0
- package/dist/proserviceworld/i18n/index.js.map +1 -0
- package/dist/proserviceworld/index.d.ts +1 -0
- package/dist/proserviceworld/index.d.ts.map +1 -1
- package/dist/proserviceworld/index.js +5 -3
- package/dist/proserviceworld/pages/AnalyticsPage.js.map +1 -1
- package/dist/proserviceworld/pages/ClientDetailPage.js.map +1 -1
- package/dist/proserviceworld/pages/ClientsPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/ClientsPage.js +173 -121
- package/dist/proserviceworld/pages/ClientsPage.js.map +1 -1
- package/dist/proserviceworld/pages/CompliancePage.js.map +1 -1
- package/dist/proserviceworld/pages/ConflictsPage.js.map +1 -1
- package/dist/proserviceworld/pages/DashboardPage.js.map +1 -1
- package/dist/proserviceworld/pages/DocumentsPage.js.map +1 -1
- package/dist/proserviceworld/pages/EngagementDetailPage.js.map +1 -1
- package/dist/proserviceworld/pages/EngagementsPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/EngagementsPage.js +168 -120
- package/dist/proserviceworld/pages/EngagementsPage.js.map +1 -1
- package/dist/proserviceworld/pages/InvoicesPage.js.map +1 -1
- package/dist/proserviceworld/pages/MattersPage.d.ts.map +1 -1
- package/dist/proserviceworld/pages/MattersPage.js +183 -144
- package/dist/proserviceworld/pages/MattersPage.js.map +1 -1
- package/dist/proserviceworld/pages/PracticeAreasPage.js.map +1 -1
- package/dist/proserviceworld/pages/TimePage.js.map +1 -1
- package/dist/proserviceworld/providers/ProServiceWorldProvider.js.map +1 -1
- package/dist/proserviceworld/services/assistantApi.js.map +1 -1
- package/dist/proserviceworld/services/createSandboxAssistantTransport.js.map +1 -1
- package/dist/proserviceworld/utils/cn.js +1 -1
- package/dist/proserviceworld/utils/cn.js.map +1 -1
- package/dist/proserviceworld/utils/native.d.ts +23 -0
- package/dist/proserviceworld/utils/native.d.ts.map +1 -0
- package/dist/proserviceworld/utils/native.js +14 -0
- package/dist/proserviceworld/utils/native.js.map +1 -0
- package/dist/proserviceworld/utils/nav.js.map +1 -1
- package/dist/proserviceworld/utils/navigation.js.map +1 -1
- package/dist/proserviceworld/utils/pageContext.js +14 -16
- package/dist/proserviceworld/utils/pageContext.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
//#region src/proserviceworld/i18n/index.ts
|
|
2
|
+
var e = {
|
|
3
|
+
en: {
|
|
4
|
+
"psw.clients.title": "Clients",
|
|
5
|
+
"psw.clients.subtitle": "Every person or organization your firm serves.",
|
|
6
|
+
"psw.clients.emptyTitle": "No clients yet",
|
|
7
|
+
"psw.clients.emptyDescription": "Add your first client to start scoping engagements and matters.",
|
|
8
|
+
"psw.clients.new": "New client",
|
|
9
|
+
"psw.clients.searchPlaceholder": "Search clients…",
|
|
10
|
+
"psw.clients.allStatuses": "All statuses",
|
|
11
|
+
"psw.common.loading": "Loading…",
|
|
12
|
+
"psw.common.retry": "Retry",
|
|
13
|
+
"psw.common.cancel": "Cancel",
|
|
14
|
+
"psw.common.save": "Save",
|
|
15
|
+
"psw.common.create": "Create",
|
|
16
|
+
"psw.common.edit": "Edit",
|
|
17
|
+
"psw.common.archive": "Archive",
|
|
18
|
+
"psw.common.actions": "Actions",
|
|
19
|
+
"psw.common.name": "Name",
|
|
20
|
+
"psw.common.status": "Status",
|
|
21
|
+
"psw.common.type": "Type",
|
|
22
|
+
"psw.common.added": "Added",
|
|
23
|
+
"psw.common.loadMore": "Load more",
|
|
24
|
+
"psw.common.showing": "Showing",
|
|
25
|
+
"psw.common.of": "of",
|
|
26
|
+
"psw.tags.title": "Tags",
|
|
27
|
+
"psw.tags.add": "Add tag"
|
|
28
|
+
},
|
|
29
|
+
es: {
|
|
30
|
+
"psw.clients.title": "Clientes",
|
|
31
|
+
"psw.clients.subtitle": "Toda persona u organización que atiende su firma.",
|
|
32
|
+
"psw.clients.emptyTitle": "Aún no hay clientes",
|
|
33
|
+
"psw.clients.emptyDescription": "Agregue su primer cliente para comenzar a definir compromisos y asuntos.",
|
|
34
|
+
"psw.clients.new": "Nuevo cliente",
|
|
35
|
+
"psw.clients.searchPlaceholder": "Buscar clientes…",
|
|
36
|
+
"psw.clients.allStatuses": "Todos los estados",
|
|
37
|
+
"psw.common.loading": "Cargando…",
|
|
38
|
+
"psw.common.retry": "Reintentar",
|
|
39
|
+
"psw.common.cancel": "Cancelar",
|
|
40
|
+
"psw.common.save": "Guardar",
|
|
41
|
+
"psw.common.create": "Crear",
|
|
42
|
+
"psw.common.edit": "Editar",
|
|
43
|
+
"psw.common.archive": "Archivar",
|
|
44
|
+
"psw.common.actions": "Acciones",
|
|
45
|
+
"psw.common.name": "Nombre",
|
|
46
|
+
"psw.common.status": "Estado",
|
|
47
|
+
"psw.common.type": "Tipo",
|
|
48
|
+
"psw.common.added": "Añadido",
|
|
49
|
+
"psw.common.loadMore": "Cargar más",
|
|
50
|
+
"psw.common.showing": "Mostrando",
|
|
51
|
+
"psw.common.of": "de",
|
|
52
|
+
"psw.tags.title": "Etiquetas",
|
|
53
|
+
"psw.tags.add": "Agregar etiqueta"
|
|
54
|
+
},
|
|
55
|
+
hi: {
|
|
56
|
+
"psw.clients.title": "ग्राहक",
|
|
57
|
+
"psw.clients.subtitle": "हर व्यक्ति या संगठन जिसे आपकी फर्म सेवा देती है।",
|
|
58
|
+
"psw.clients.emptyTitle": "अभी तक कोई ग्राहक नहीं",
|
|
59
|
+
"psw.clients.emptyDescription": "समझौते और मामलों का दायरा तय करना शुरू करने के लिए अपना पहला ग्राहक जोड़ें।",
|
|
60
|
+
"psw.clients.new": "नया ग्राहक",
|
|
61
|
+
"psw.clients.searchPlaceholder": "ग्राहक खोजें…",
|
|
62
|
+
"psw.clients.allStatuses": "सभी स्थिति",
|
|
63
|
+
"psw.common.loading": "लोड हो रहा है…",
|
|
64
|
+
"psw.common.retry": "पुनः प्रयास करें",
|
|
65
|
+
"psw.common.cancel": "रद्द करें",
|
|
66
|
+
"psw.common.save": "सहेजें",
|
|
67
|
+
"psw.common.create": "बनाएं",
|
|
68
|
+
"psw.common.edit": "संपादित करें",
|
|
69
|
+
"psw.common.archive": "संग्रहीत करें",
|
|
70
|
+
"psw.common.actions": "कार्रवाइयाँ",
|
|
71
|
+
"psw.common.name": "नाम",
|
|
72
|
+
"psw.common.status": "स्थिति",
|
|
73
|
+
"psw.common.type": "प्रकार",
|
|
74
|
+
"psw.common.added": "जोड़ा गया",
|
|
75
|
+
"psw.common.loadMore": "और लोड करें",
|
|
76
|
+
"psw.common.showing": "दिखा रहा है",
|
|
77
|
+
"psw.common.of": "में से",
|
|
78
|
+
"psw.tags.title": "टैग",
|
|
79
|
+
"psw.tags.add": "टैग जोड़ें"
|
|
80
|
+
},
|
|
81
|
+
ta: {
|
|
82
|
+
"psw.clients.title": "வாடிக்கையாளர்கள்",
|
|
83
|
+
"psw.clients.subtitle": "உங்கள் நிறுவனம் சேவை செய்யும் ஒவ்வொரு நபரும் அல்லது நிறுவனமும்.",
|
|
84
|
+
"psw.clients.emptyTitle": "இன்னும் வாடிக்கையாளர்கள் இல்லை",
|
|
85
|
+
"psw.clients.emptyDescription": "உறுதிமொழிகள் மற்றும் விவகாரங்களை வரையறுக்க முதல் வாடிக்கையாளரைச் சேர்க்கவும்.",
|
|
86
|
+
"psw.clients.new": "புதிய வாடிக்கையாளர்",
|
|
87
|
+
"psw.clients.searchPlaceholder": "வாடிக்கையாளர்களைத் தேடு…",
|
|
88
|
+
"psw.clients.allStatuses": "அனைத்து நிலைகள்",
|
|
89
|
+
"psw.common.loading": "ஏற்றுகிறது…",
|
|
90
|
+
"psw.common.retry": "மீண்டும் முயற்சி",
|
|
91
|
+
"psw.common.cancel": "ரத்து",
|
|
92
|
+
"psw.common.save": "சேமி",
|
|
93
|
+
"psw.common.create": "உருவாக்கு",
|
|
94
|
+
"psw.common.edit": "திருத்து",
|
|
95
|
+
"psw.common.archive": "காப்பகம்",
|
|
96
|
+
"psw.common.actions": "செயல்கள்",
|
|
97
|
+
"psw.common.name": "பெயர்",
|
|
98
|
+
"psw.common.status": "நிலை",
|
|
99
|
+
"psw.common.type": "வகை",
|
|
100
|
+
"psw.common.added": "சேர்க்கப்பட்டது",
|
|
101
|
+
"psw.common.loadMore": "மேலும் ஏற்று",
|
|
102
|
+
"psw.common.showing": "காட்டுகிறது",
|
|
103
|
+
"psw.common.of": "இல்",
|
|
104
|
+
"psw.tags.title": "குறிச்சொற்கள்",
|
|
105
|
+
"psw.tags.add": "குறிச்சொல் சேர்"
|
|
106
|
+
},
|
|
107
|
+
zh: {
|
|
108
|
+
"psw.clients.title": "客户",
|
|
109
|
+
"psw.clients.subtitle": "贵公司服务的每一个人或组织。",
|
|
110
|
+
"psw.clients.emptyTitle": "暂无客户",
|
|
111
|
+
"psw.clients.emptyDescription": "添加您的第一个客户,开始确定业务和事项范围。",
|
|
112
|
+
"psw.clients.new": "新建客户",
|
|
113
|
+
"psw.clients.searchPlaceholder": "搜索客户…",
|
|
114
|
+
"psw.clients.allStatuses": "全部状态",
|
|
115
|
+
"psw.common.loading": "加载中…",
|
|
116
|
+
"psw.common.retry": "重试",
|
|
117
|
+
"psw.common.cancel": "取消",
|
|
118
|
+
"psw.common.save": "保存",
|
|
119
|
+
"psw.common.create": "创建",
|
|
120
|
+
"psw.common.edit": "编辑",
|
|
121
|
+
"psw.common.archive": "归档",
|
|
122
|
+
"psw.common.actions": "操作",
|
|
123
|
+
"psw.common.name": "名称",
|
|
124
|
+
"psw.common.status": "状态",
|
|
125
|
+
"psw.common.type": "类型",
|
|
126
|
+
"psw.common.added": "添加时间",
|
|
127
|
+
"psw.common.loadMore": "加载更多",
|
|
128
|
+
"psw.common.showing": "显示",
|
|
129
|
+
"psw.common.of": "共",
|
|
130
|
+
"psw.tags.title": "标签",
|
|
131
|
+
"psw.tags.add": "添加标签"
|
|
132
|
+
},
|
|
133
|
+
ar: {
|
|
134
|
+
"psw.clients.title": "العملاء",
|
|
135
|
+
"psw.clients.subtitle": "كل شخص أو مؤسسة تخدمها شركتك.",
|
|
136
|
+
"psw.clients.emptyTitle": "لا يوجد عملاء بعد",
|
|
137
|
+
"psw.clients.emptyDescription": "أضف عميلك الأول لبدء تحديد نطاق الالتزامات والقضايا.",
|
|
138
|
+
"psw.clients.new": "عميل جديد",
|
|
139
|
+
"psw.clients.searchPlaceholder": "البحث في العملاء…",
|
|
140
|
+
"psw.clients.allStatuses": "جميع الحالات",
|
|
141
|
+
"psw.common.loading": "جارٍ التحميل…",
|
|
142
|
+
"psw.common.retry": "إعادة المحاولة",
|
|
143
|
+
"psw.common.cancel": "إلغاء",
|
|
144
|
+
"psw.common.save": "حفظ",
|
|
145
|
+
"psw.common.create": "إنشاء",
|
|
146
|
+
"psw.common.edit": "تعديل",
|
|
147
|
+
"psw.common.archive": "أرشفة",
|
|
148
|
+
"psw.common.actions": "إجراءات",
|
|
149
|
+
"psw.common.name": "الاسم",
|
|
150
|
+
"psw.common.status": "الحالة",
|
|
151
|
+
"psw.common.type": "النوع",
|
|
152
|
+
"psw.common.added": "تاريخ الإضافة",
|
|
153
|
+
"psw.common.loadMore": "تحميل المزيد",
|
|
154
|
+
"psw.common.showing": "عرض",
|
|
155
|
+
"psw.common.of": "من",
|
|
156
|
+
"psw.tags.title": "الوسوم",
|
|
157
|
+
"psw.tags.add": "إضافة وسم"
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
function t() {
|
|
161
|
+
if (typeof navigator > "u") return "en";
|
|
162
|
+
let t = (navigator.language ?? "en").split("-")[0].toLowerCase();
|
|
163
|
+
return t in e ? t : "en";
|
|
164
|
+
}
|
|
165
|
+
function n(n, r, i) {
|
|
166
|
+
return e[i ?? t()]?.[n] ?? e.en[n] ?? r ?? n;
|
|
167
|
+
}
|
|
168
|
+
//#endregion
|
|
169
|
+
export { n as t };
|
|
170
|
+
|
|
171
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/proserviceworld/i18n/index.ts"],"sourcesContent":["/**\n * ProServiceWorld MFE local i18n.\n *\n * The host app shell owns the global I18nProvider and product translations.\n * This lightweight module provides fallback translations for MFE-owned UI\n * strings (page titles, empty states, form labels) so the MFE can be mounted\n * standalone (dev harness, tests) and still render in all supported locales.\n * When running inside the shell, the shell's `useI18n` translations take\n * precedence via the `t` helper below.\n */\n\nexport type SupportedLocale = 'en' | 'es' | 'hi' | 'ta' | 'zh' | 'ar';\n\nconst translations: Record<SupportedLocale, Record<string, string>> = {\n en: {\n 'psw.clients.title': 'Clients',\n 'psw.clients.subtitle': 'Every person or organization your firm serves.',\n 'psw.clients.emptyTitle': 'No clients yet',\n 'psw.clients.emptyDescription':\n 'Add your first client to start scoping engagements and matters.',\n 'psw.clients.new': 'New client',\n 'psw.clients.searchPlaceholder': 'Search clients…',\n 'psw.clients.allStatuses': 'All statuses',\n 'psw.common.loading': 'Loading…',\n 'psw.common.retry': 'Retry',\n 'psw.common.cancel': 'Cancel',\n 'psw.common.save': 'Save',\n 'psw.common.create': 'Create',\n 'psw.common.edit': 'Edit',\n 'psw.common.archive': 'Archive',\n 'psw.common.actions': 'Actions',\n 'psw.common.name': 'Name',\n 'psw.common.status': 'Status',\n 'psw.common.type': 'Type',\n 'psw.common.added': 'Added',\n 'psw.common.loadMore': 'Load more',\n 'psw.common.showing': 'Showing',\n 'psw.common.of': 'of',\n 'psw.tags.title': 'Tags',\n 'psw.tags.add': 'Add tag',\n },\n es: {\n 'psw.clients.title': 'Clientes',\n 'psw.clients.subtitle': 'Toda persona u organización que atiende su firma.',\n 'psw.clients.emptyTitle': 'Aún no hay clientes',\n 'psw.clients.emptyDescription':\n 'Agregue su primer cliente para comenzar a definir compromisos y asuntos.',\n 'psw.clients.new': 'Nuevo cliente',\n 'psw.clients.searchPlaceholder': 'Buscar clientes…',\n 'psw.clients.allStatuses': 'Todos los estados',\n 'psw.common.loading': 'Cargando…',\n 'psw.common.retry': 'Reintentar',\n 'psw.common.cancel': 'Cancelar',\n 'psw.common.save': 'Guardar',\n 'psw.common.create': 'Crear',\n 'psw.common.edit': 'Editar',\n 'psw.common.archive': 'Archivar',\n 'psw.common.actions': 'Acciones',\n 'psw.common.name': 'Nombre',\n 'psw.common.status': 'Estado',\n 'psw.common.type': 'Tipo',\n 'psw.common.added': 'Añadido',\n 'psw.common.loadMore': 'Cargar más',\n 'psw.common.showing': 'Mostrando',\n 'psw.common.of': 'de',\n 'psw.tags.title': 'Etiquetas',\n 'psw.tags.add': 'Agregar etiqueta',\n },\n hi: {\n 'psw.clients.title': 'ग्राहक',\n 'psw.clients.subtitle': 'हर व्यक्ति या संगठन जिसे आपकी फर्म सेवा देती है।',\n 'psw.clients.emptyTitle': 'अभी तक कोई ग्राहक नहीं',\n 'psw.clients.emptyDescription':\n 'समझौते और मामलों का दायरा तय करना शुरू करने के लिए अपना पहला ग्राहक जोड़ें।',\n 'psw.clients.new': 'नया ग्राहक',\n 'psw.clients.searchPlaceholder': 'ग्राहक खोजें…',\n 'psw.clients.allStatuses': 'सभी स्थिति',\n 'psw.common.loading': 'लोड हो रहा है…',\n 'psw.common.retry': 'पुनः प्रयास करें',\n 'psw.common.cancel': 'रद्द करें',\n 'psw.common.save': 'सहेजें',\n 'psw.common.create': 'बनाएं',\n 'psw.common.edit': 'संपादित करें',\n 'psw.common.archive': 'संग्रहीत करें',\n 'psw.common.actions': 'कार्रवाइयाँ',\n 'psw.common.name': 'नाम',\n 'psw.common.status': 'स्थिति',\n 'psw.common.type': 'प्रकार',\n 'psw.common.added': 'जोड़ा गया',\n 'psw.common.loadMore': 'और लोड करें',\n 'psw.common.showing': 'दिखा रहा है',\n 'psw.common.of': 'में से',\n 'psw.tags.title': 'टैग',\n 'psw.tags.add': 'टैग जोड़ें',\n },\n ta: {\n 'psw.clients.title': 'வாடிக்கையாளர்கள்',\n 'psw.clients.subtitle': 'உங்கள் நிறுவனம் சேவை செய்யும் ஒவ்வொரு நபரும் அல்லது நிறுவனமும்.',\n 'psw.clients.emptyTitle': 'இன்னும் வாடிக்கையாளர்கள் இல்லை',\n 'psw.clients.emptyDescription':\n 'உறுதிமொழிகள் மற்றும் விவகாரங்களை வரையறுக்க முதல் வாடிக்கையாளரைச் சேர்க்கவும்.',\n 'psw.clients.new': 'புதிய வாடிக்கையாளர்',\n 'psw.clients.searchPlaceholder': 'வாடிக்கையாளர்களைத் தேடு…',\n 'psw.clients.allStatuses': 'அனைத்து நிலைகள்',\n 'psw.common.loading': 'ஏற்றுகிறது…',\n 'psw.common.retry': 'மீண்டும் முயற்சி',\n 'psw.common.cancel': 'ரத்து',\n 'psw.common.save': 'சேமி',\n 'psw.common.create': 'உருவாக்கு',\n 'psw.common.edit': 'திருத்து',\n 'psw.common.archive': 'காப்பகம்',\n 'psw.common.actions': 'செயல்கள்',\n 'psw.common.name': 'பெயர்',\n 'psw.common.status': 'நிலை',\n 'psw.common.type': 'வகை',\n 'psw.common.added': 'சேர்க்கப்பட்டது',\n 'psw.common.loadMore': 'மேலும் ஏற்று',\n 'psw.common.showing': 'காட்டுகிறது',\n 'psw.common.of': 'இல்',\n 'psw.tags.title': 'குறிச்சொற்கள்',\n 'psw.tags.add': 'குறிச்சொல் சேர்',\n },\n zh: {\n 'psw.clients.title': '客户',\n 'psw.clients.subtitle': '贵公司服务的每一个人或组织。',\n 'psw.clients.emptyTitle': '暂无客户',\n 'psw.clients.emptyDescription': '添加您的第一个客户,开始确定业务和事项范围。',\n 'psw.clients.new': '新建客户',\n 'psw.clients.searchPlaceholder': '搜索客户…',\n 'psw.clients.allStatuses': '全部状态',\n 'psw.common.loading': '加载中…',\n 'psw.common.retry': '重试',\n 'psw.common.cancel': '取消',\n 'psw.common.save': '保存',\n 'psw.common.create': '创建',\n 'psw.common.edit': '编辑',\n 'psw.common.archive': '归档',\n 'psw.common.actions': '操作',\n 'psw.common.name': '名称',\n 'psw.common.status': '状态',\n 'psw.common.type': '类型',\n 'psw.common.added': '添加时间',\n 'psw.common.loadMore': '加载更多',\n 'psw.common.showing': '显示',\n 'psw.common.of': '共',\n 'psw.tags.title': '标签',\n 'psw.tags.add': '添加标签',\n },\n ar: {\n 'psw.clients.title': 'العملاء',\n 'psw.clients.subtitle': 'كل شخص أو مؤسسة تخدمها شركتك.',\n 'psw.clients.emptyTitle': 'لا يوجد عملاء بعد',\n 'psw.clients.emptyDescription': 'أضف عميلك الأول لبدء تحديد نطاق الالتزامات والقضايا.',\n 'psw.clients.new': 'عميل جديد',\n 'psw.clients.searchPlaceholder': 'البحث في العملاء…',\n 'psw.clients.allStatuses': 'جميع الحالات',\n 'psw.common.loading': 'جارٍ التحميل…',\n 'psw.common.retry': 'إعادة المحاولة',\n 'psw.common.cancel': 'إلغاء',\n 'psw.common.save': 'حفظ',\n 'psw.common.create': 'إنشاء',\n 'psw.common.edit': 'تعديل',\n 'psw.common.archive': 'أرشفة',\n 'psw.common.actions': 'إجراءات',\n 'psw.common.name': 'الاسم',\n 'psw.common.status': 'الحالة',\n 'psw.common.type': 'النوع',\n 'psw.common.added': 'تاريخ الإضافة',\n 'psw.common.loadMore': 'تحميل المزيد',\n 'psw.common.showing': 'عرض',\n 'psw.common.of': 'من',\n 'psw.tags.title': 'الوسوم',\n 'psw.tags.add': 'إضافة وسم',\n },\n};\n\nfunction detectLocale(): SupportedLocale {\n if (typeof navigator === 'undefined') return 'en';\n const code = (navigator.language ?? 'en').split('-')[0].toLowerCase();\n if (code in translations) return code as SupportedLocale;\n return 'en';\n}\n\nexport function t(key: string, fallback?: string, locale?: SupportedLocale): string {\n const loc = locale ?? detectLocale();\n return translations[loc]?.[key] ?? translations.en[key] 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AAU,EAAa,EACX,GAAG,MAAQ,EAAa,GAAG,MAAQ,KAAY;AACzE"}
|
|
@@ -2,4 +2,5 @@ export { ProServiceWorldRoot } from './ProServiceWorldRoot';
|
|
|
2
2
|
export type { ProServiceWorldRootProps, NavItem, FooterItem } from './types';
|
|
3
3
|
export { useProServiceWorld } from './providers/ProServiceWorldProvider';
|
|
4
4
|
export { useSandboxAssistantTransport } from './services/createSandboxAssistantTransport';
|
|
5
|
+
export { t } from './i18n';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/proserviceworld/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/proserviceworld/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,wBAAwB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import "./providers/ProServiceWorldProvider.js";
|
|
2
|
-
import "./ProServiceWorldRoot.js";
|
|
3
|
-
import "./services/createSandboxAssistantTransport.js";
|
|
1
|
+
import { useProServiceWorld as e } from "./providers/ProServiceWorldProvider.js";
|
|
2
|
+
import { ProServiceWorldRoot as t } from "./ProServiceWorldRoot.js";
|
|
3
|
+
import { useSandboxAssistantTransport as n } from "./services/createSandboxAssistantTransport.js";
|
|
4
|
+
import { t as r } from "./i18n/index.js";
|
|
5
|
+
export { t as ProServiceWorldRoot, r as t, e as useProServiceWorld, n as useSandboxAssistantTransport };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsPage.js","names":[],"sources":["../../../src/proserviceworld/pages/AnalyticsPage.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { BarChart3, TrendingUp, Clock, Wallet } from 'lucide-react';\nimport { useDashboardStats } from '../hooks/useProServiceWorldApi';\nimport { cn } from '../utils/cn';\nimport {\n PageHeader,\n SectionCard,\n MetricCard,\n LoadingBlock,\n ErrorState,\n StatusPill,\n fmtMoney,\n fmtHours,\n} from '../components/ui';\n\nexport const AnalyticsPage: FC = () => {\n const { data, isLoading, error, refetch } = useDashboardStats();\n if (isLoading) return <LoadingBlock label=\"Crunching numbers…\" />;\n if (error) return <ErrorState error={error} onRetry={() => void refetch()} />;\n if (!data) return null;\n\n const totalHours = data.unbilledHours + data.billedHours;\n const utilization = totalHours > 0 ? Math.round((data.billedHours / totalHours) * 100) : 0;\n const billableBase = data.paidInvoiceTotal + data.outstandingInvoiceTotal;\n const collectionRate =\n billableBase > 0 ? Math.round((data.paidInvoiceTotal / billableBase) * 100) : 0;\n\n return (\n <div className=\"space-y-6\">\n <PageHeader\n title=\"Analytics\"\n subtitle=\"Real, live metrics across the practice — no estimates, straight from your records.\"\n icon={<BarChart3 className=\"h-6 w-6\" />}\n />\n\n <div className=\"grid grid-cols-2 gap-3 lg:grid-cols-4\">\n <MetricCard\n label=\"Collected revenue\"\n value={fmtMoney(data.paidInvoiceTotal)}\n hint={`${fmtMoney(billableBase)} invoiced`}\n icon={<Wallet className=\"h-4 w-4\" />}\n tone=\"success\"\n />\n <MetricCard\n label=\"Collection rate\"\n value={`${collectionRate}%`}\n hint={`${fmtMoney(data.outstandingInvoiceTotal)} outstanding`}\n icon={<TrendingUp className=\"h-4 w-4\" />}\n tone=\"accent\"\n />\n <MetricCard\n label=\"Utilization\"\n value={`${utilization}%`}\n hint={`${fmtHours(data.billedHours)} of ${fmtHours(totalHours)}`}\n icon={<Clock className=\"h-4 w-4\" />}\n tone=\"info\"\n />\n <MetricCard\n label=\"Active engagements\"\n value={data.activeEngagements}\n hint={`${data.openMatters} open matters`}\n icon={<BarChart3 className=\"h-4 w-4\" />}\n tone=\"warning\"\n />\n </div>\n\n {/* Practice-health meters — collection & utilization at a glance */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <SectionCard title=\"Collection rate\" description=\"Paid vs. total invoiced.\">\n <GaugeRow\n pct={collectionRate}\n tone=\"accent\"\n primary={fmtMoney(data.paidInvoiceTotal)}\n primaryLabel=\"Collected\"\n secondary={fmtMoney(data.outstandingInvoiceTotal)}\n secondaryLabel=\"Outstanding\"\n />\n </SectionCard>\n <SectionCard title=\"Utilization\" description=\"Billed vs. total logged hours.\">\n <GaugeRow\n pct={utilization}\n tone=\"info\"\n primary={fmtHours(data.billedHours)}\n primaryLabel=\"Billed\"\n secondary={fmtHours(data.unbilledHours)}\n secondaryLabel=\"Unbilled\"\n />\n </SectionCard>\n </div>\n\n <SectionCard title=\"Revenue by month\" description=\"Invoiced totals across recent months.\">\n <RevenueChart data={data.revenueByMonth} />\n </SectionCard>\n\n <div className=\"grid grid-cols-1 gap-4 lg:grid-cols-3\">\n <SectionCard title=\"Engagements\" description=\"By status\">\n <Distribution items={data.engagementsByStatus} />\n </SectionCard>\n <SectionCard title=\"Matters\" description=\"By status\">\n <Distribution items={data.mattersByStatus} />\n </SectionCard>\n <SectionCard title=\"Invoices\" description=\"By status\">\n <Distribution items={data.invoicesByStatus} />\n </SectionCard>\n </div>\n\n <SectionCard title=\"Time & billing\" description=\"Billable capacity across the practice.\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <HoursBar\n label=\"Billed hours\"\n value={data.billedHours}\n total={totalHours}\n tone=\"accent\"\n />\n <HoursBar\n label=\"Unbilled hours\"\n value={data.unbilledHours}\n total={totalHours}\n tone=\"warning\"\n />\n </div>\n </SectionCard>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Radial gauge with a supporting two-number legend\n// ---------------------------------------------------------------------------\nconst GaugeRow: FC<{\n pct: number;\n tone: 'accent' | 'info';\n primary: string;\n primaryLabel: string;\n secondary: string;\n secondaryLabel: string;\n}> = ({ pct, tone, primary, primaryLabel, secondary, secondaryLabel }) => (\n <div className=\"flex items-center gap-5\">\n <Gauge pct={pct} tone={tone} />\n <div className=\"flex flex-1 flex-col gap-2.5\">\n <div className=\"flex items-baseline justify-between gap-3\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-tertiary\">\n {primaryLabel}\n </span>\n <span className=\"text-sm font-semibold tabular-nums text-text-primary\">{primary}</span>\n </div>\n <div className=\"h-px bg-border-seam\" />\n <div className=\"flex items-baseline justify-between gap-3\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-tertiary\">\n {secondaryLabel}\n </span>\n <span className=\"text-sm font-semibold tabular-nums text-text-secondary\">{secondary}</span>\n </div>\n </div>\n </div>\n);\n\nconst Gauge: FC<{ pct: number; tone: 'accent' | 'info' }> = ({ pct, tone }) => {\n const clamped = Math.max(0, Math.min(100, pct));\n const r = 34;\n const c = 2 * Math.PI * r;\n const dash = (clamped / 100) * c;\n return (\n <div\n className={cn(\n 'relative h-24 w-24 shrink-0',\n tone === 'accent' ? 'text-accent' : 'text-text-link'\n )}\n >\n <svg viewBox=\"0 0 80 80\" className=\"h-full w-full -rotate-90\">\n <circle\n cx=\"40\"\n cy=\"40\"\n r={r}\n fill=\"none\"\n strokeWidth=\"8\"\n className=\"text-bg-sunken\"\n stroke=\"currentColor\"\n />\n <circle\n cx=\"40\"\n cy=\"40\"\n r={r}\n fill=\"none\"\n strokeWidth=\"8\"\n strokeLinecap=\"round\"\n stroke=\"currentColor\"\n strokeDasharray={`${dash} ${c}`}\n className=\"transition-[stroke-dasharray] duration-700\"\n />\n </svg>\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <span className=\"text-lg font-bold tabular-nums text-text-primary\">{clamped}%</span>\n </div>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Revenue chart — gradient columns with value labels + month axis\n// ---------------------------------------------------------------------------\nconst RevenueChart: FC<{ data: { month: string; amount: number }[] }> = ({ data }) => {\n if (!data.length) return <p className=\"text-sm text-text-tertiary\">No invoiced revenue yet.</p>;\n const peak = Math.max(...data.map((d) => d.amount), 1);\n return (\n <div className=\"overflow-x-auto\">\n <div className=\"min-w-[520px]\">\n <div className=\"flex h-60 items-end gap-2 border-b border-border-seam\">\n {data.map((d) => (\n <div\n key={d.month}\n className=\"group flex h-full flex-1 flex-col items-center justify-end gap-1.5\"\n >\n <span className=\"whitespace-nowrap text-[10px] font-semibold tabular-nums text-text-secondary\">\n {fmtMoney(d.amount)}\n </span>\n <div\n className=\"w-full max-w-[3rem] rounded-t-lg bg-gradient-to-t from-accent/50 to-accent shadow-sm transition-all duration-200 group-hover:-translate-y-1 group-hover:shadow-md\"\n style={{ height: `${Math.max((d.amount / peak) * 90, 2)}%` }}\n title={fmtMoney(d.amount)}\n />\n </div>\n ))}\n </div>\n <div className=\"mt-2 flex gap-2\">\n {data.map((d) => (\n <span key={d.month} className=\"flex-1 text-center text-xs text-text-tertiary\">\n {monthShort(d.month)}\n </span>\n ))}\n </div>\n </div>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Distribution — tone-colored gradient bars with count + share\n// ---------------------------------------------------------------------------\nconst Distribution: FC<{ items: { status: string; count: number }[] }> = ({ items }) => {\n if (!items.length) return <p className=\"text-sm text-text-tertiary\">No records yet.</p>;\n const max = Math.max(...items.map((i) => i.count), 1);\n const total = items.reduce((s, i) => s + i.count, 0) || 1;\n return (\n <ul className=\"space-y-3.5\">\n {items.map((i) => (\n <li\n key={i.status}\n className=\"grid grid-cols-[7.5rem_minmax(0,1fr)_auto] items-center gap-3\"\n >\n <StatusPill status={i.status} className=\"justify-self-start\" />\n <div className=\"h-2.5 overflow-hidden rounded-full bg-bg-sunken\">\n <div\n className={cn(\n 'h-full rounded-full bg-gradient-to-r transition-all duration-500',\n barGradientFor(i.status)\n )}\n style={{ width: `${Math.max((i.count / max) * 100, 4)}%` }}\n />\n </div>\n <span className=\"flex items-baseline justify-end gap-1.5 tabular-nums\">\n <span className=\"text-sm font-semibold text-text-primary\">{i.count}</span>\n <span className=\"text-xs text-text-tertiary\">\n {Math.round((i.count / total) * 100)}%\n </span>\n </span>\n </li>\n ))}\n </ul>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Hours bar — big gradient progress meter (billed vs unbilled)\n// ---------------------------------------------------------------------------\nconst HoursBar: FC<{ label: string; value: number; total: number; tone: 'accent' | 'warning' }> = ({\n label,\n value,\n total,\n tone,\n}) => {\n const pct = total > 0 ? Math.round((value / total) * 100) : 0;\n const grad =\n tone === 'accent'\n ? 'from-accent/60 to-accent'\n : 'from-status-warning-text/60 to-status-warning-text';\n return (\n <div className=\"rounded-xl border border-border-seam bg-bg-canvas p-4\">\n <div className=\"mb-2.5 flex items-center justify-between gap-3\">\n <span className=\"text-sm font-medium text-text-secondary\">{label}</span>\n <span className=\"text-sm font-semibold tabular-nums text-text-primary\">\n {fmtHours(value)} · {pct}%\n </span>\n </div>\n <div className=\"h-3 overflow-hidden rounded-full bg-bg-sunken\">\n <div\n className={cn('h-full rounded-full bg-gradient-to-r transition-all duration-700', grad)}\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Chart helpers (token-driven; self-contained to this page)\n// ---------------------------------------------------------------------------\ntype BarTone = 'success' | 'warning' | 'danger' | 'info' | 'accent' | 'neutral';\n\nconst BAR_GRADIENT: Record<BarTone, string> = {\n success: 'from-status-success-text/55 to-status-success-text',\n warning: 'from-status-warning-text/55 to-status-warning-text',\n danger: 'from-status-error-text/55 to-status-error-text',\n info: 'from-text-link/55 to-text-link',\n accent: 'from-accent/55 to-accent',\n neutral: 'from-text-tertiary/30 to-text-tertiary/70',\n};\n\n/** Mirror of the shared StatusPill tone mapping, used to tint chart bars. */\nconst STATUS_BAR_TONE: Record<string, BarTone> = {\n ACTIVE: 'success',\n DELIVERED: 'success',\n INVOICED: 'success',\n PAID: 'success',\n APPROVED: 'success',\n PASSED: 'success',\n CLEAR: 'success',\n COMPLETED: 'success',\n FINAL: 'success',\n PROSPECT: 'info',\n PROPOSAL: 'info',\n MEDIUM: 'info',\n INTERNAL_REVIEW: 'info',\n SUBMITTED: 'info',\n SENT: 'info',\n IN_REVIEW: 'info',\n REVIEW: 'warning',\n ON_HOLD: 'warning',\n HIGH: 'warning',\n CLIENT_REVIEW: 'warning',\n PENDING: 'warning',\n POTENTIAL_CONFLICT: 'warning',\n CANCELLED: 'danger',\n CRITICAL: 'danger',\n REJECTED: 'danger',\n OVERDUE: 'danger',\n FAILED: 'danger',\n CONFLICT: 'danger',\n ACCEPTED: 'accent',\n IN_PROGRESS: 'accent',\n OPEN: 'accent',\n BILLED: 'accent',\n INACTIVE: 'neutral',\n ARCHIVED: 'neutral',\n CLOSED: 'neutral',\n LOW: 'neutral',\n DRAFT: 'neutral',\n WAIVED: 'neutral',\n};\n\nfunction barGradientFor(status: string): string {\n return BAR_GRADIENT[STATUS_BAR_TONE[status] ?? 'accent'];\n}\n\n/** \"2026-07\" → \"Jul\" (falls back to the raw value if unparseable). */\nfunction monthShort(m: string): string {\n const [y, mo] = m.split('-').map(Number);\n if (!y || !mo) return m;\n const d = new Date(y, mo - 1, 1);\n return Number.isNaN(d.getTime()) ? m : d.toLocaleDateString(undefined, { month: 'short' });\n}\n"],"mappings":";;;;;;AAeA,IAAa,UAA0B;CACrC,IAAM,EAAE,SAAM,cAAW,UAAO,eAAY,GAAmB;AAC/D,KAAI,EAAW,QAAO,kBAAC,GAAD,EAAc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ACP,QAAQ;CACT;AAED,SAAS,EAAe,GAAwB;AAC9C,QAAO,EAAa,EAAgB,MAAW;;AAIjD,SAAS,EAAW,GAAmB;CACrC,IAAM,CAAC,GAAG,KAAM,EAAE,MAAM,IAAI,CAAC,IAAI,OAAO;AACxC,KAAI,CAAC,KAAK,CAAC,EAAI,QAAO;CACtB,IAAM,IAAI,IAAI,KAAK,GAAG,IAAK,GAAG,EAAE;AAChC,QAAO,OAAO,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI,EAAE,mBAAmB,KAAA,GAAW,EAAE,OAAO,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"AnalyticsPage.js","names":[],"sources":["../../../src/proserviceworld/pages/AnalyticsPage.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { BarChart3, TrendingUp, Clock, Wallet } from 'lucide-react';\nimport { useDashboardStats } from '../hooks/useProServiceWorldApi';\nimport { cn } from '../utils/cn';\nimport {\n PageHeader,\n SectionCard,\n MetricCard,\n LoadingBlock,\n ErrorState,\n StatusPill,\n fmtMoney,\n fmtHours,\n} from '../components/ui';\n\nexport const AnalyticsPage: FC = () => {\n const { data, isLoading, error, refetch } = useDashboardStats();\n if (isLoading) return <LoadingBlock label=\"Crunching numbers…\" />;\n if (error) return <ErrorState error={error} onRetry={() => void refetch()} />;\n if (!data) return null;\n\n const totalHours = data.unbilledHours + data.billedHours;\n const utilization = totalHours > 0 ? Math.round((data.billedHours / totalHours) * 100) : 0;\n const billableBase = data.paidInvoiceTotal + data.outstandingInvoiceTotal;\n const collectionRate =\n billableBase > 0 ? Math.round((data.paidInvoiceTotal / billableBase) * 100) : 0;\n\n return (\n <div className=\"space-y-6\">\n <PageHeader\n title=\"Analytics\"\n subtitle=\"Real, live metrics across the practice — no estimates, straight from your records.\"\n icon={<BarChart3 className=\"h-6 w-6\" />}\n />\n\n <div className=\"grid grid-cols-2 gap-3 lg:grid-cols-4\">\n <MetricCard\n label=\"Collected revenue\"\n value={fmtMoney(data.paidInvoiceTotal)}\n hint={`${fmtMoney(billableBase)} invoiced`}\n icon={<Wallet className=\"h-4 w-4\" />}\n tone=\"success\"\n />\n <MetricCard\n label=\"Collection rate\"\n value={`${collectionRate}%`}\n hint={`${fmtMoney(data.outstandingInvoiceTotal)} outstanding`}\n icon={<TrendingUp className=\"h-4 w-4\" />}\n tone=\"accent\"\n />\n <MetricCard\n label=\"Utilization\"\n value={`${utilization}%`}\n hint={`${fmtHours(data.billedHours)} of ${fmtHours(totalHours)}`}\n icon={<Clock className=\"h-4 w-4\" />}\n tone=\"info\"\n />\n <MetricCard\n label=\"Active engagements\"\n value={data.activeEngagements}\n hint={`${data.openMatters} open matters`}\n icon={<BarChart3 className=\"h-4 w-4\" />}\n tone=\"warning\"\n />\n </div>\n\n {/* Practice-health meters — collection & utilization at a glance */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <SectionCard title=\"Collection rate\" description=\"Paid vs. total invoiced.\">\n <GaugeRow\n pct={collectionRate}\n tone=\"accent\"\n primary={fmtMoney(data.paidInvoiceTotal)}\n primaryLabel=\"Collected\"\n secondary={fmtMoney(data.outstandingInvoiceTotal)}\n secondaryLabel=\"Outstanding\"\n />\n </SectionCard>\n <SectionCard title=\"Utilization\" description=\"Billed vs. total logged hours.\">\n <GaugeRow\n pct={utilization}\n tone=\"info\"\n primary={fmtHours(data.billedHours)}\n primaryLabel=\"Billed\"\n secondary={fmtHours(data.unbilledHours)}\n secondaryLabel=\"Unbilled\"\n />\n </SectionCard>\n </div>\n\n <SectionCard title=\"Revenue by month\" description=\"Invoiced totals across recent months.\">\n <RevenueChart data={data.revenueByMonth} />\n </SectionCard>\n\n <div className=\"grid grid-cols-1 gap-4 lg:grid-cols-3\">\n <SectionCard title=\"Engagements\" description=\"By status\">\n <Distribution items={data.engagementsByStatus} />\n </SectionCard>\n <SectionCard title=\"Matters\" description=\"By status\">\n <Distribution items={data.mattersByStatus} />\n </SectionCard>\n <SectionCard title=\"Invoices\" description=\"By status\">\n <Distribution items={data.invoicesByStatus} />\n </SectionCard>\n </div>\n\n <SectionCard title=\"Time & billing\" description=\"Billable capacity across the practice.\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <HoursBar\n label=\"Billed hours\"\n value={data.billedHours}\n total={totalHours}\n tone=\"accent\"\n />\n <HoursBar\n label=\"Unbilled hours\"\n value={data.unbilledHours}\n total={totalHours}\n tone=\"warning\"\n />\n </div>\n </SectionCard>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Radial gauge with a supporting two-number legend\n// ---------------------------------------------------------------------------\nconst GaugeRow: FC<{\n pct: number;\n tone: 'accent' | 'info';\n primary: string;\n primaryLabel: string;\n secondary: string;\n secondaryLabel: string;\n}> = ({ pct, tone, primary, primaryLabel, secondary, secondaryLabel }) => (\n <div className=\"flex items-center gap-5\">\n <Gauge pct={pct} tone={tone} />\n <div className=\"flex flex-1 flex-col gap-2.5\">\n <div className=\"flex items-baseline justify-between gap-3\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-tertiary\">\n {primaryLabel}\n </span>\n <span className=\"text-sm font-semibold tabular-nums text-text-primary\">{primary}</span>\n </div>\n <div className=\"h-px bg-border-seam\" />\n <div className=\"flex items-baseline justify-between gap-3\">\n <span className=\"text-xs font-medium uppercase tracking-wider text-text-tertiary\">\n {secondaryLabel}\n </span>\n <span className=\"text-sm font-semibold tabular-nums text-text-secondary\">{secondary}</span>\n </div>\n </div>\n </div>\n);\n\nconst Gauge: FC<{ pct: number; tone: 'accent' | 'info' }> = ({ pct, tone }) => {\n const clamped = Math.max(0, Math.min(100, pct));\n const r = 34;\n const c = 2 * Math.PI * r;\n const dash = (clamped / 100) * c;\n return (\n <div\n className={cn(\n 'relative h-24 w-24 shrink-0',\n tone === 'accent' ? 'text-accent' : 'text-text-link'\n )}\n >\n <svg viewBox=\"0 0 80 80\" className=\"h-full w-full -rotate-90\">\n <circle\n cx=\"40\"\n cy=\"40\"\n r={r}\n fill=\"none\"\n strokeWidth=\"8\"\n className=\"text-bg-sunken\"\n stroke=\"currentColor\"\n />\n <circle\n cx=\"40\"\n cy=\"40\"\n r={r}\n fill=\"none\"\n strokeWidth=\"8\"\n strokeLinecap=\"round\"\n stroke=\"currentColor\"\n strokeDasharray={`${dash} ${c}`}\n className=\"transition-[stroke-dasharray] duration-700\"\n />\n </svg>\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <span className=\"text-lg font-bold tabular-nums text-text-primary\">{clamped}%</span>\n </div>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Revenue chart — gradient columns with value labels + month axis\n// ---------------------------------------------------------------------------\nconst RevenueChart: FC<{ data: { month: string; amount: number }[] }> = ({ data }) => {\n if (!data.length) return <p className=\"text-sm text-text-tertiary\">No invoiced revenue yet.</p>;\n const peak = Math.max(...data.map((d) => d.amount), 1);\n return (\n <div className=\"overflow-x-auto\">\n <div className=\"min-w-[520px]\">\n <div className=\"flex h-60 items-end gap-2 border-b border-border-seam\">\n {data.map((d) => (\n <div\n key={d.month}\n className=\"group flex h-full flex-1 flex-col items-center justify-end gap-1.5\"\n >\n <span className=\"whitespace-nowrap text-[10px] font-semibold tabular-nums text-text-secondary\">\n {fmtMoney(d.amount)}\n </span>\n <div\n className=\"w-full max-w-[3rem] rounded-t-lg bg-gradient-to-t from-accent/50 to-accent shadow-sm transition-all duration-200 group-hover:-translate-y-1 group-hover:shadow-md\"\n style={{ height: `${Math.max((d.amount / peak) * 90, 2)}%` }}\n title={fmtMoney(d.amount)}\n />\n </div>\n ))}\n </div>\n <div className=\"mt-2 flex gap-2\">\n {data.map((d) => (\n <span key={d.month} className=\"flex-1 text-center text-xs text-text-tertiary\">\n {monthShort(d.month)}\n </span>\n ))}\n </div>\n </div>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Distribution — tone-colored gradient bars with count + share\n// ---------------------------------------------------------------------------\nconst Distribution: FC<{ items: { status: string; count: number }[] }> = ({ items }) => {\n if (!items.length) return <p className=\"text-sm text-text-tertiary\">No records yet.</p>;\n const max = Math.max(...items.map((i) => i.count), 1);\n const total = items.reduce((s, i) => s + i.count, 0) || 1;\n return (\n <ul className=\"space-y-3.5\">\n {items.map((i) => (\n <li\n key={i.status}\n className=\"grid grid-cols-[7.5rem_minmax(0,1fr)_auto] items-center gap-3\"\n >\n <StatusPill status={i.status} className=\"justify-self-start\" />\n <div className=\"h-2.5 overflow-hidden rounded-full bg-bg-sunken\">\n <div\n className={cn(\n 'h-full rounded-full bg-gradient-to-r transition-all duration-500',\n barGradientFor(i.status)\n )}\n style={{ width: `${Math.max((i.count / max) * 100, 4)}%` }}\n />\n </div>\n <span className=\"flex items-baseline justify-end gap-1.5 tabular-nums\">\n <span className=\"text-sm font-semibold text-text-primary\">{i.count}</span>\n <span className=\"text-xs text-text-tertiary\">\n {Math.round((i.count / total) * 100)}%\n </span>\n </span>\n </li>\n ))}\n </ul>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Hours bar — big gradient progress meter (billed vs unbilled)\n// ---------------------------------------------------------------------------\nconst HoursBar: FC<{ label: string; value: number; total: number; tone: 'accent' | 'warning' }> = ({\n label,\n value,\n total,\n tone,\n}) => {\n const pct = total > 0 ? Math.round((value / total) * 100) : 0;\n const grad =\n tone === 'accent'\n ? 'from-accent/60 to-accent'\n : 'from-status-warning-text/60 to-status-warning-text';\n return (\n <div className=\"rounded-xl border border-border-seam bg-bg-canvas p-4\">\n <div className=\"mb-2.5 flex items-center justify-between gap-3\">\n <span className=\"text-sm font-medium text-text-secondary\">{label}</span>\n <span className=\"text-sm font-semibold tabular-nums text-text-primary\">\n {fmtHours(value)} · {pct}%\n </span>\n </div>\n <div className=\"h-3 overflow-hidden rounded-full bg-bg-sunken\">\n <div\n className={cn('h-full rounded-full bg-gradient-to-r transition-all duration-700', grad)}\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Chart helpers (token-driven; self-contained to this page)\n// ---------------------------------------------------------------------------\ntype BarTone = 'success' | 'warning' | 'danger' | 'info' | 'accent' | 'neutral';\n\nconst BAR_GRADIENT: Record<BarTone, string> = {\n success: 'from-status-success-text/55 to-status-success-text',\n warning: 'from-status-warning-text/55 to-status-warning-text',\n danger: 'from-status-error-text/55 to-status-error-text',\n info: 'from-text-link/55 to-text-link',\n accent: 'from-accent/55 to-accent',\n neutral: 'from-text-tertiary/30 to-text-tertiary/70',\n};\n\n/** Mirror of the shared StatusPill tone mapping, used to tint chart bars. */\nconst STATUS_BAR_TONE: Record<string, BarTone> = {\n ACTIVE: 'success',\n DELIVERED: 'success',\n INVOICED: 'success',\n PAID: 'success',\n APPROVED: 'success',\n PASSED: 'success',\n CLEAR: 'success',\n COMPLETED: 'success',\n FINAL: 'success',\n PROSPECT: 'info',\n PROPOSAL: 'info',\n MEDIUM: 'info',\n INTERNAL_REVIEW: 'info',\n SUBMITTED: 'info',\n SENT: 'info',\n IN_REVIEW: 'info',\n REVIEW: 'warning',\n ON_HOLD: 'warning',\n HIGH: 'warning',\n CLIENT_REVIEW: 'warning',\n PENDING: 'warning',\n POTENTIAL_CONFLICT: 'warning',\n CANCELLED: 'danger',\n CRITICAL: 'danger',\n REJECTED: 'danger',\n OVERDUE: 'danger',\n FAILED: 'danger',\n CONFLICT: 'danger',\n ACCEPTED: 'accent',\n IN_PROGRESS: 'accent',\n OPEN: 'accent',\n BILLED: 'accent',\n INACTIVE: 'neutral',\n ARCHIVED: 'neutral',\n CLOSED: 'neutral',\n LOW: 'neutral',\n DRAFT: 'neutral',\n WAIVED: 'neutral',\n};\n\nfunction barGradientFor(status: string): string {\n return BAR_GRADIENT[STATUS_BAR_TONE[status] ?? 'accent'];\n}\n\n/** \"2026-07\" → \"Jul\" (falls back to the raw value if unparseable). */\nfunction monthShort(m: string): string {\n const [y, mo] = m.split('-').map(Number);\n if (!y || !mo) return m;\n const d = new Date(y, mo - 1, 1);\n return Number.isNaN(d.getTime()) ? m : d.toLocaleDateString(undefined, { month: 'short' });\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AU;CACV,UAAU;CACV,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,aAAa;CACb,MAAM;CACN,QAAQ;CACR,UAAU;CACV,UAAU;CACV,QAAQ;CACR,KAAK;CACL,OAAO;CACP,QAAQ;AACV;AAEA,SAAS,EAAe,GAAwB;CAC9C,OAAO,EAAa,EAAgB,MAAW;AACjD;AAGA,SAAS,EAAW,GAAmB;CACrC,IAAM,CAAC,GAAG,KAAM,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM;CACvC,IAAI,CAAC,KAAK,CAAC,GAAI,OAAO;CACtB,IAAM,IAAI,IAAI,KAAK,GAAG,IAAK,GAAG,CAAC;CAC/B,OAAO,OAAO,MAAM,EAAE,QAAQ,CAAC,IAAI,IAAI,EAAE,mBAAmB,KAAA,GAAW,EAAE,OAAO,QAAQ,CAAC;AAC3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientDetailPage.js","names":[],"sources":["../../../src/proserviceworld/pages/ClientDetailPage.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport {\n ArrowLeft,\n Briefcase,\n FolderKanban,\n GitBranch,\n Mail,\n Phone,\n MapPin,\n Plus,\n StickyNote,\n ChevronRight,\n} from 'lucide-react';\nimport {\n useClient,\n useConflictChecks,\n useCreateConflictCheck,\n type PswEngagement,\n type PswMatter,\n} from '../hooks/useProServiceWorldApi';\nimport { useNav } from '../utils/nav';\nimport { cn } from '../utils/cn';\nimport { DiscussionThread } from '../components/DiscussionThread';\nimport {\n PageHeader,\n SectionCard,\n LoadingBlock,\n ErrorState,\n Empty,\n StatusPill,\n Modal,\n Field,\n TextInput,\n TextArea,\n Banner,\n TableWrap,\n Th,\n Td,\n fmtDate,\n fmtMoney,\n humanize,\n} from '../components/ui';\n\nconst initials = (name: string): string =>\n name\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, 2)\n .map((w) => w[0]?.toUpperCase() ?? '')\n .join('') || '?';\n\nexport const ClientDetailPage: FC = () => {\n const { id = '' } = useParams();\n const nav = useNav();\n const { data: client, isLoading, error, refetch } = useClient(id);\n const conflicts = useConflictChecks({ clientId: id });\n const [runConflict, setRunConflict] = useState(false);\n\n if (isLoading) return <LoadingBlock />;\n if (error) return <ErrorState error={error} onRetry={() => void refetch()} />;\n if (!client)\n return (\n <Empty\n title=\"Client not found\"\n description=\"It may have been archived or belongs to another workspace.\"\n />\n );\n\n const avatarName = client.contactName || client.name;\n\n return (\n <div className=\"space-y-6\">\n <button\n type=\"button\"\n onClick={() => nav('clients')}\n className=\"flex items-center gap-1.5 text-sm text-text-secondary transition-colors hover:text-accent\"\n >\n <ArrowLeft className=\"h-4 w-4\" /> Back to clients\n </button>\n\n <PageHeader\n title={client.name}\n subtitle={[client.type === 'ORGANIZATION' ? 'Organization' : 'Individual', client.industry]\n .filter(Boolean)\n .join(' · ')}\n actions={<StatusPill status={client.status} />}\n />\n\n {client.tags.length > 0 && (\n <div className=\"flex flex-wrap gap-2\">\n {client.tags.map((t) => (\n <span\n key={t}\n className=\"rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\"\n >\n {t}\n </span>\n ))}\n </div>\n )}\n\n <div className=\"grid grid-cols-1 gap-4 lg:grid-cols-3\">\n <SectionCard title=\"Contact\" className=\"lg:col-span-1\">\n <div className=\"space-y-4\">\n <div className=\"flex items-center gap-3\">\n <span className=\"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-accent/10 text-sm font-semibold text-accent ring-1 ring-inset ring-accent/15\">\n {initials(avatarName)}\n </span>\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-semibold text-text-primary\">\n {client.contactName || client.name}\n </div>\n <div className=\"truncate text-xs text-text-tertiary\">\n {client.contactName ? 'Primary contact' : 'Client record'}\n </div>\n </div>\n </div>\n\n <dl className=\"space-y-2.5 text-sm\">\n {client.contactEmail && (\n <IconRow icon={<Mail className=\"h-4 w-4\" />} value={client.contactEmail} />\n )}\n {client.contactPhone && (\n <IconRow icon={<Phone className=\"h-4 w-4\" />} value={client.contactPhone} />\n )}\n {client.address && (\n <IconRow icon={<MapPin className=\"h-4 w-4\" />} value={client.address} />\n )}\n {client.notes && (\n <IconRow icon={<StickyNote className=\"h-4 w-4\" />} value={client.notes} multiline />\n )}\n {!client.contactEmail && !client.contactPhone && !client.address && !client.notes && (\n <p className=\"text-sm text-text-tertiary\">No contact details recorded yet.</p>\n )}\n </dl>\n </div>\n </SectionCard>\n\n <SectionCard\n title=\"Conflict checks\"\n className=\"lg:col-span-2\"\n action={\n <Button size=\"sm\" variant=\"outline\" onClick={() => setRunConflict(true)}>\n <GitBranch className=\"mr-1.5 h-4 w-4\" /> Run check\n </Button>\n }\n >\n {conflicts.isLoading ? (\n <LoadingBlock label=\"Loading…\" />\n ) : !conflicts.data || conflicts.data.length === 0 ? (\n <Empty\n title=\"No conflict checks\"\n description=\"Run a conflict check before accepting new work for this client.\"\n icon={<GitBranch className=\"h-7 w-7\" />}\n />\n ) : (\n <TableWrap>\n <thead>\n <tr>\n <Th>Parties searched</Th>\n <Th>Date</Th>\n <Th className=\"text-right\">Status</Th>\n </tr>\n </thead>\n <tbody>\n {conflicts.data.map((c) => (\n <tr key={c.id} className=\"transition-colors hover:bg-bg-sunken/60\">\n <Td>\n <div className=\"font-medium text-text-primary\">\n {c.searchedParties.join(', ') || 'Conflict search'}\n </div>\n {c.findings ? (\n <div className=\"text-xs text-text-tertiary\">{c.findings}</div>\n ) : null}\n </Td>\n <Td className=\"whitespace-nowrap\">{fmtDate(c.createdAt)}</Td>\n <Td className=\"text-right\">\n <StatusPill status={c.status} />\n </Td>\n </tr>\n ))}\n </tbody>\n </TableWrap>\n )}\n </SectionCard>\n </div>\n\n <SectionCard\n title=\"Engagements\"\n description={`${client.engagements.length} scoped for this client`}\n action={\n <Button size=\"sm\" variant=\"outline\" onClick={() => nav('engagements')}>\n <Plus className=\"mr-1.5 h-4 w-4\" />\n Manage\n </Button>\n }\n >\n {client.engagements.length === 0 ? (\n <Empty\n title=\"No engagements\"\n description=\"Scope the first engagement for this client.\"\n icon={<Briefcase className=\"h-7 w-7\" />}\n />\n ) : (\n <TableWrap>\n <thead>\n <tr>\n <Th>Engagement</Th>\n <Th>Fee</Th>\n <Th>Started</Th>\n <Th className=\"text-right\">Status</Th>\n </tr>\n </thead>\n <tbody>\n {client.engagements.map((e: PswEngagement) => (\n <tr\n key={e.id}\n className=\"group cursor-pointer transition-colors hover:bg-bg-sunken/60\"\n onClick={() => nav(`engagements/${e.id}`)}\n >\n <Td>\n <div className=\"flex items-center gap-1 font-medium text-text-primary transition-colors group-hover:text-accent\">\n <span>{e.name}</span>\n <ChevronRight className=\"h-3.5 w-3.5 shrink-0 text-text-tertiary opacity-0 transition-opacity group-hover:opacity-100\" />\n </div>\n </Td>\n <Td className=\"whitespace-nowrap\">\n {fmtMoney(e.feeAmount, e.currency)}{' '}\n <span className=\"text-xs text-text-tertiary\">\n / {humanize(e.feeArrangement)}\n </span>\n </Td>\n <Td className=\"whitespace-nowrap\">{fmtDate(e.startDate)}</Td>\n <Td className=\"text-right\">\n <StatusPill status={e.status} />\n </Td>\n </tr>\n ))}\n </tbody>\n </TableWrap>\n )}\n </SectionCard>\n\n <SectionCard\n title=\"Matters\"\n description={`${client.matters.length} tracked for this client`}\n action={\n <Button size=\"sm\" variant=\"outline\" onClick={() => nav('matters')}>\n <Plus className=\"mr-1.5 h-4 w-4\" />\n Manage\n </Button>\n }\n >\n {client.matters.length === 0 ? (\n <Empty\n title=\"No matters\"\n description=\"Open a matter to track regulated work for this client.\"\n icon={<FolderKanban className=\"h-7 w-7\" />}\n />\n ) : (\n <TableWrap>\n <thead>\n <tr>\n <Th>Reference</Th>\n <Th>Title</Th>\n <Th>Due</Th>\n <Th>Priority</Th>\n <Th className=\"text-right\">Status</Th>\n </tr>\n </thead>\n <tbody>\n {client.matters.map((m: PswMatter) => (\n <tr key={m.id} className=\"transition-colors hover:bg-bg-sunken/60\">\n <Td className=\"whitespace-nowrap font-medium text-text-primary\">\n {m.reference || '—'}\n </Td>\n <Td>{m.title}</Td>\n <Td className=\"whitespace-nowrap\">{fmtDate(m.dueDate)}</Td>\n <Td>\n <StatusPill status={m.priority} />\n </Td>\n <Td className=\"text-right\">\n <StatusPill status={m.status} />\n </Td>\n </tr>\n ))}\n </tbody>\n </TableWrap>\n )}\n </SectionCard>\n\n <DiscussionThread entityType=\"proserviceworld-client\" entityId={id} />\n\n {runConflict && (\n <ConflictModal\n clientId={id}\n onClose={() => setRunConflict(false)}\n onDone={() => void conflicts.refetch()}\n />\n )}\n </div>\n );\n};\n\nconst IconRow: FC<{ icon: React.ReactNode; value: string; multiline?: boolean }> = ({\n icon,\n value,\n multiline,\n}) => (\n <div\n className={cn('flex gap-2.5 text-text-secondary', multiline ? 'items-start' : 'items-center')}\n >\n <span className=\"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-tertiary\">\n {icon}\n </span>\n <span className={cn('min-w-0 break-words', multiline ? 'leading-relaxed' : 'truncate')}>\n {value}\n </span>\n </div>\n);\n\nconst ConflictModal: FC<{ clientId: string; onClose: () => void; onDone: () => void }> = ({\n clientId,\n onClose,\n onDone,\n}) => {\n const create = useCreateConflictCheck();\n const [parties, setParties] = useState('');\n const [findings, setFindings] = useState('');\n const [err, setErr] = useState<string | null>(null);\n\n const submit = () => {\n setErr(null);\n const searchedParties = parties\n .split(',')\n .map((p) => p.trim())\n .filter(Boolean);\n if (searchedParties.length === 0) return setErr('Add at least one party to search.');\n create.mutate(\n { clientId, searchedParties, findings: findings.trim() || null },\n {\n onSuccess: () => {\n onDone();\n onClose();\n },\n onError: (e) => setErr(e instanceof Error ? e.message : 'Failed.'),\n }\n );\n };\n\n return (\n <Modal\n open\n onClose={onClose}\n title=\"Run conflict check\"\n footer={\n <>\n <Button variant=\"outline\" onClick={onClose} disabled={create.isPending}>\n Cancel\n </Button>\n <Button onClick={submit} disabled={create.isPending}>\n {create.isPending ? 'Running…' : 'Record check'}\n </Button>\n </>\n }\n >\n <div className=\"space-y-3\">\n {err && <Banner tone=\"danger\">{err}</Banner>}\n <Field\n label=\"Parties searched\"\n required\n hint=\"Comma-separated — counterparties, related entities, principals.\"\n >\n <TextInput\n value={parties}\n onChange={(e) => setParties(e.target.value)}\n placeholder=\"Beta Corp, John Roe, Gamma LLP\"\n />\n </Field>\n <Field label=\"Findings\">\n <TextArea\n value={findings}\n onChange={(e) => setFindings(e.target.value)}\n placeholder=\"Notes on any potential conflicts…\"\n />\n </Field>\n </div>\n </Modal>\n );\n};\n"],"mappings":";;;;;;;;;;;AA8CA,IAAM,KAAY,MAChB,EACG,MAAM,MAAM,CACZ,OAAO,QAAQ,CACf,MAAM,GAAG,EAAE,CACX,KAAK,MAAM,EAAE,IAAI,aAAa,IAAI,GAAG,CACrC,KAAK,GAAG,IAAI,KAEJ,UAA6B;CACxC,IAAM,EAAE,QAAK,OAAO,GAAW,EACzB,IAAM,GAAQ,EACd,EAAE,MAAM,GAAQ,cAAW,UAAO,eAAY,EAAU,EAAG,EAC3D,IAAY,EAAkB,EAAE,UAAU,GAAI,CAAC,EAC/C,CAAC,GAAa,KAAkB,EAAS,GAAM;AAErD,KAAI,EAAW,QAAO,kBAAC,GAAD,EAAgB,CAAA;AACtC,KAAI,EAAO,QAAO,kBAAC,GAAD;EAAmB;EAAO,eAAe,KAAK,GAAS;EAAI,CAAA;AAC7E,KAAI,CAAC,EACH,QACE,kBAAC,GAAD;EACE,OAAM;EACN,aAAY;EACZ,CAAA;CAGN,IAAM,IAAa,EAAO,eAAe,EAAO;AAEhD,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,EAAI,UAAU;IAC7B,WAAU;cAHZ,CAKE,kBAAC,GAAD,EAAW,WAAU,WAAY,CAAA,EAAA,mBAC1B;;GAET,kBAA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AAE,UAAU,UAAU;KACnE,CACF;;GAa8B,UAAU,EAAO;aACvC,EAAO,YAAY,aAAa;GAC1B,CAAA,CACR,EAAA,CAAA;YAGL,kBAAC,OAAD;GAAK,WAAU;aAAf;IACG,KAAO,kBAAC,GAAD;KAAQ,MAAK;eAAU;KAAa,CAAA;IAC5C,kBAAC,GAAD;KACE,OAAM;KACN,UAAA;KACA,MAAK;eAEL,kBAAC,GAAD;MACE,OAAO;MACP,WAAW,MAAM,EAAW,EAAE,OAAO,MAAM;MAC3C,aAAY;MACZ,CAAA;KACI,CAAA;IACR,kBAAC,GAAD;KAAO,OAAM;eACX,kBAAC,GAAD;MACE,OAAO;MACP,WAAW,MAAM,EAAY,EAAE,OAAO,MAAM;MAC5C,aAAY;MACZ,CAAA;KACI,CAAA;IACJ;;EACA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ClientDetailPage.js","names":[],"sources":["../../../src/proserviceworld/pages/ClientDetailPage.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport {\n ArrowLeft,\n Briefcase,\n FolderKanban,\n GitBranch,\n Mail,\n Phone,\n MapPin,\n Plus,\n StickyNote,\n ChevronRight,\n} from 'lucide-react';\nimport {\n useClient,\n useConflictChecks,\n useCreateConflictCheck,\n type PswEngagement,\n type PswMatter,\n} from '../hooks/useProServiceWorldApi';\nimport { useNav } from '../utils/nav';\nimport { cn } from '../utils/cn';\nimport { DiscussionThread } from '../components/DiscussionThread';\nimport {\n PageHeader,\n SectionCard,\n LoadingBlock,\n ErrorState,\n Empty,\n StatusPill,\n Modal,\n Field,\n TextInput,\n TextArea,\n Banner,\n TableWrap,\n Th,\n Td,\n fmtDate,\n fmtMoney,\n humanize,\n} from '../components/ui';\n\nconst initials = (name: string): string =>\n name\n .split(/\\s+/)\n .filter(Boolean)\n .slice(0, 2)\n .map((w) => w[0]?.toUpperCase() ?? '')\n .join('') || '?';\n\nexport const ClientDetailPage: FC = () => {\n const { id = '' } = useParams();\n const nav = useNav();\n const { data: client, isLoading, error, refetch } = useClient(id);\n const conflicts = useConflictChecks({ clientId: id });\n const [runConflict, setRunConflict] = useState(false);\n\n if (isLoading) return <LoadingBlock />;\n if (error) return <ErrorState error={error} onRetry={() => void refetch()} />;\n if (!client)\n return (\n <Empty\n title=\"Client not found\"\n description=\"It may have been archived or belongs to another workspace.\"\n />\n );\n\n const avatarName = client.contactName || client.name;\n\n return (\n <div className=\"space-y-6\">\n <button\n type=\"button\"\n onClick={() => nav('clients')}\n className=\"flex items-center gap-1.5 text-sm text-text-secondary transition-colors hover:text-accent\"\n >\n <ArrowLeft className=\"h-4 w-4\" /> Back to clients\n </button>\n\n <PageHeader\n title={client.name}\n subtitle={[client.type === 'ORGANIZATION' ? 'Organization' : 'Individual', client.industry]\n .filter(Boolean)\n .join(' · ')}\n actions={<StatusPill status={client.status} />}\n />\n\n {client.tags.length > 0 && (\n <div className=\"flex flex-wrap gap-2\">\n {client.tags.map((t) => (\n <span\n key={t}\n className=\"rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\"\n >\n {t}\n </span>\n ))}\n </div>\n )}\n\n <div className=\"grid grid-cols-1 gap-4 lg:grid-cols-3\">\n <SectionCard title=\"Contact\" className=\"lg:col-span-1\">\n <div className=\"space-y-4\">\n <div className=\"flex items-center gap-3\">\n <span className=\"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-accent/10 text-sm font-semibold text-accent ring-1 ring-inset ring-accent/15\">\n {initials(avatarName)}\n </span>\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-semibold text-text-primary\">\n {client.contactName || client.name}\n </div>\n <div className=\"truncate text-xs text-text-tertiary\">\n {client.contactName ? 'Primary contact' : 'Client record'}\n </div>\n </div>\n </div>\n\n <dl className=\"space-y-2.5 text-sm\">\n {client.contactEmail && (\n <IconRow icon={<Mail className=\"h-4 w-4\" />} value={client.contactEmail} />\n )}\n {client.contactPhone && (\n <IconRow icon={<Phone className=\"h-4 w-4\" />} value={client.contactPhone} />\n )}\n {client.address && (\n <IconRow icon={<MapPin className=\"h-4 w-4\" />} value={client.address} />\n )}\n {client.notes && (\n <IconRow icon={<StickyNote className=\"h-4 w-4\" />} value={client.notes} multiline />\n )}\n {!client.contactEmail && !client.contactPhone && !client.address && !client.notes && (\n <p className=\"text-sm text-text-tertiary\">No contact details recorded yet.</p>\n )}\n </dl>\n </div>\n </SectionCard>\n\n <SectionCard\n title=\"Conflict checks\"\n className=\"lg:col-span-2\"\n action={\n <Button size=\"sm\" variant=\"outline\" onClick={() => setRunConflict(true)}>\n <GitBranch className=\"mr-1.5 h-4 w-4\" /> Run check\n </Button>\n }\n >\n {conflicts.isLoading ? (\n <LoadingBlock label=\"Loading…\" />\n ) : !conflicts.data || conflicts.data.length === 0 ? (\n <Empty\n title=\"No conflict checks\"\n description=\"Run a conflict check before accepting new work for this client.\"\n icon={<GitBranch className=\"h-7 w-7\" />}\n />\n ) : (\n <TableWrap>\n <thead>\n <tr>\n <Th>Parties searched</Th>\n <Th>Date</Th>\n <Th className=\"text-right\">Status</Th>\n </tr>\n </thead>\n <tbody>\n {conflicts.data.map((c) => (\n <tr key={c.id} className=\"transition-colors hover:bg-bg-sunken/60\">\n <Td>\n <div className=\"font-medium text-text-primary\">\n {c.searchedParties.join(', ') || 'Conflict search'}\n </div>\n {c.findings ? (\n <div className=\"text-xs text-text-tertiary\">{c.findings}</div>\n ) : null}\n </Td>\n <Td className=\"whitespace-nowrap\">{fmtDate(c.createdAt)}</Td>\n <Td className=\"text-right\">\n <StatusPill status={c.status} />\n </Td>\n </tr>\n ))}\n </tbody>\n </TableWrap>\n )}\n </SectionCard>\n </div>\n\n <SectionCard\n title=\"Engagements\"\n description={`${client.engagements.length} scoped for this client`}\n action={\n <Button size=\"sm\" variant=\"outline\" onClick={() => nav('engagements')}>\n <Plus className=\"mr-1.5 h-4 w-4\" />\n Manage\n </Button>\n }\n >\n {client.engagements.length === 0 ? (\n <Empty\n title=\"No engagements\"\n description=\"Scope the first engagement for this client.\"\n icon={<Briefcase className=\"h-7 w-7\" />}\n />\n ) : (\n <TableWrap>\n <thead>\n <tr>\n <Th>Engagement</Th>\n <Th>Fee</Th>\n <Th>Started</Th>\n <Th className=\"text-right\">Status</Th>\n </tr>\n </thead>\n <tbody>\n {client.engagements.map((e: PswEngagement) => (\n <tr\n key={e.id}\n className=\"group cursor-pointer transition-colors hover:bg-bg-sunken/60\"\n onClick={() => nav(`engagements/${e.id}`)}\n >\n <Td>\n <div className=\"flex items-center gap-1 font-medium text-text-primary transition-colors group-hover:text-accent\">\n <span>{e.name}</span>\n <ChevronRight className=\"h-3.5 w-3.5 shrink-0 text-text-tertiary opacity-0 transition-opacity group-hover:opacity-100\" />\n </div>\n </Td>\n <Td className=\"whitespace-nowrap\">\n {fmtMoney(e.feeAmount, e.currency)}{' '}\n <span className=\"text-xs text-text-tertiary\">\n / {humanize(e.feeArrangement)}\n </span>\n </Td>\n <Td className=\"whitespace-nowrap\">{fmtDate(e.startDate)}</Td>\n <Td className=\"text-right\">\n <StatusPill status={e.status} />\n </Td>\n </tr>\n ))}\n </tbody>\n </TableWrap>\n )}\n </SectionCard>\n\n <SectionCard\n title=\"Matters\"\n description={`${client.matters.length} tracked for this client`}\n action={\n <Button size=\"sm\" variant=\"outline\" onClick={() => nav('matters')}>\n <Plus className=\"mr-1.5 h-4 w-4\" />\n Manage\n </Button>\n }\n >\n {client.matters.length === 0 ? (\n <Empty\n title=\"No matters\"\n description=\"Open a matter to track regulated work for this client.\"\n icon={<FolderKanban className=\"h-7 w-7\" />}\n />\n ) : (\n <TableWrap>\n <thead>\n <tr>\n <Th>Reference</Th>\n <Th>Title</Th>\n <Th>Due</Th>\n <Th>Priority</Th>\n <Th className=\"text-right\">Status</Th>\n </tr>\n </thead>\n <tbody>\n {client.matters.map((m: PswMatter) => (\n <tr key={m.id} className=\"transition-colors hover:bg-bg-sunken/60\">\n <Td className=\"whitespace-nowrap font-medium text-text-primary\">\n {m.reference || '—'}\n </Td>\n <Td>{m.title}</Td>\n <Td className=\"whitespace-nowrap\">{fmtDate(m.dueDate)}</Td>\n <Td>\n <StatusPill status={m.priority} />\n </Td>\n <Td className=\"text-right\">\n <StatusPill status={m.status} />\n </Td>\n </tr>\n ))}\n </tbody>\n </TableWrap>\n )}\n </SectionCard>\n\n <DiscussionThread entityType=\"proserviceworld-client\" entityId={id} />\n\n {runConflict && (\n <ConflictModal\n clientId={id}\n onClose={() => setRunConflict(false)}\n onDone={() => void conflicts.refetch()}\n />\n )}\n </div>\n );\n};\n\nconst IconRow: FC<{ icon: React.ReactNode; value: string; multiline?: boolean }> = ({\n icon,\n value,\n multiline,\n}) => (\n <div\n className={cn('flex gap-2.5 text-text-secondary', multiline ? 'items-start' : 'items-center')}\n >\n <span className=\"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-tertiary\">\n {icon}\n </span>\n <span className={cn('min-w-0 break-words', multiline ? 'leading-relaxed' : 'truncate')}>\n {value}\n </span>\n </div>\n);\n\nconst ConflictModal: FC<{ clientId: string; onClose: () => void; onDone: () => void }> = ({\n clientId,\n onClose,\n onDone,\n}) => {\n const create = useCreateConflictCheck();\n const [parties, setParties] = useState('');\n const [findings, setFindings] = useState('');\n const [err, setErr] = useState<string | null>(null);\n\n const submit = () => {\n setErr(null);\n const searchedParties = parties\n .split(',')\n .map((p) => p.trim())\n .filter(Boolean);\n if (searchedParties.length === 0) return setErr('Add at least one party to search.');\n create.mutate(\n { clientId, searchedParties, findings: findings.trim() || null },\n {\n onSuccess: () => {\n onDone();\n onClose();\n },\n onError: (e) => setErr(e instanceof Error ? e.message : 'Failed.'),\n }\n );\n };\n\n return (\n <Modal\n open\n onClose={onClose}\n title=\"Run conflict check\"\n footer={\n <>\n <Button variant=\"outline\" onClick={onClose} disabled={create.isPending}>\n Cancel\n </Button>\n <Button onClick={submit} disabled={create.isPending}>\n {create.isPending ? 'Running…' : 'Record check'}\n </Button>\n </>\n }\n >\n <div className=\"space-y-3\">\n {err && <Banner tone=\"danger\">{err}</Banner>}\n <Field\n label=\"Parties searched\"\n required\n hint=\"Comma-separated — counterparties, related entities, principals.\"\n >\n <TextInput\n value={parties}\n onChange={(e) => setParties(e.target.value)}\n placeholder=\"Beta Corp, John Roe, Gamma LLP\"\n />\n </Field>\n <Field label=\"Findings\">\n <TextArea\n value={findings}\n onChange={(e) => setFindings(e.target.value)}\n placeholder=\"Notes on any potential conflicts…\"\n />\n </Field>\n </div>\n </Modal>\n );\n};\n"],"mappings":";;;;;;;;;;;AA8CA,IAAM,KAAY,MAChB,EACG,MAAM,KAAK,CAAC,CACZ,OAAO,OAAO,CAAC,CACf,MAAM,GAAG,CAAC,CAAC,CACX,KAAK,MAAM,EAAE,EAAE,EAAE,YAAY,KAAK,EAAE,CAAC,CACrC,KAAK,EAAE,KAAK,KAEJ,UAA6B;CACxC,IAAM,EAAE,QAAK,OAAO,EAAU,GACxB,IAAM,EAAO,GACb,EAAE,MAAM,GAAQ,cAAW,UAAO,eAAY,EAAU,CAAE,GAC1D,IAAY,EAAkB,EAAE,UAAU,EAAG,CAAC,GAC9C,CAAC,GAAa,KAAkB,EAAS,EAAK;CAEpD,IAAI,GAAW,OAAO,kBAAC,GAAD,CAAe,CAAA;CACrC,IAAI,GAAO,OAAO,kBAAC,GAAD;EAAmB;EAAO,eAAe,KAAK,EAAQ;CAAI,CAAA;CAC5E,IAAI,CAAC,GACH,OACE,kBAAC,GAAD;EACE,OAAM;EACN,aAAY;CACb,CAAA;CAGL,IAAM,IAAa,EAAO,eAAe,EAAO;CAEhD,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,EAAI,SAAS;IAC5B,WAAU;cAHZ,CAKE,kBAAC,GAAD,EAAW,WAAU,UAAW,CAAA,GAAC,kBAC3B;;GAER,kBAAC,GAAD;IACE,OAAO,EAA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Q,EAAE,UAAU,SAAS;IACnE,CACF;GACF;GAYiC,UAAU,EAAO;aACvC,EAAO,YAAY,aAAa;EAC3B,CAAA,CACR,EAAA,CAAA;YAGJ,kBAAC,OAAD;GAAK,WAAU;aAAf;IACG,KAAO,kBAAC,GAAD;KAAQ,MAAK;eAAU;IAAY,CAAA;IAC3C,kBAAC,GAAD;KACE,OAAM;KACN,UAAA;KACA,MAAK;eAEL,kBAAC,GAAD;MACE,OAAO;MACP,WAAW,MAAM,EAAW,EAAE,OAAO,KAAK;MAC1C,aAAY;KACb,CAAA;IACI,CAAA;IACP,kBAAC,GAAD;KAAO,OAAM;eACX,kBAAC,GAAD;MACE,OAAO;MACP,WAAW,MAAM,EAAY,EAAE,OAAO,KAAK;MAC3C,aAAY;KACb,CAAA;IACI,CAAA;GACJ;;CACA,CAAA;AAEX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientsPage.d.ts","sourceRoot":"","sources":["../../../src/proserviceworld/pages/ClientsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ClientsPage.d.ts","sourceRoot":"","sources":["../../../src/proserviceworld/pages/ClientsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAkDhC,qDAAqD;AACrD,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAU3D,CAAC;AAyBF,eAAO,MAAM,WAAW,EAAE,EAwNzB,CAAC"}
|