@enyxs/wikex-components 0.11.14 → 0.11.16
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/README.md +15 -0
- package/dist/consultation-model.d.mts +47 -0
- package/dist/consultation-model.d.ts +47 -0
- package/dist/consultation-model.js +58 -0
- package/dist/consultation-model.js.map +1 -0
- package/dist/consultation-model.mjs +28 -0
- package/dist/consultation-model.mjs.map +1 -0
- package/dist/consultations.d.mts +28 -0
- package/dist/consultations.d.ts +28 -0
- package/dist/consultations.js +295 -0
- package/dist/consultations.js.map +1 -0
- package/dist/consultations.mjs +269 -0
- package/dist/consultations.mjs.map +1 -0
- package/dist/index.d.mts +54 -2
- package/dist/index.d.ts +54 -2
- package/dist/index.js +2035 -1450
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1491 -919
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -129,3 +129,18 @@ filtering, pagination and ordering helpers from
|
|
|
129
129
|
`@enyxs/wikex-components/fees/model`. This entry has no React or CMS dependency
|
|
130
130
|
and can run on a backend. Strict validation throws for invalid table data;
|
|
131
131
|
`parseFeesTable` retains public rendering's legacy fallback behavior.
|
|
132
|
+
|
|
133
|
+
## Consultation forms and management
|
|
134
|
+
|
|
135
|
+
The original landing registration renderer accepts `onConsultationSubmit`, an
|
|
136
|
+
async callback receiving `ConsultationSubmission` exported from the root entry.
|
|
137
|
+
It preserves the existing form style, uses MUI selects and shows accessible
|
|
138
|
+
success/error notices. While sending, fields are disabled; failures retain the
|
|
139
|
+
values and submission ID for idempotent retries. Success clears all fields.
|
|
140
|
+
Editable CMS previews do not submit live requests. The host owns the endpoint,
|
|
141
|
+
validation, authentication and storage. The separate partnership form is unchanged.
|
|
142
|
+
|
|
143
|
+
Use `ConsultationManager` from `@enyxs/wikex-components/consultations` for the
|
|
144
|
+
controlled admin table, filters, pagination, detail/status/notes dialog and delete
|
|
145
|
+
confirmation. Supply data, permissions and API callbacks. Pure models and labels
|
|
146
|
+
are exported from `@enyxs/wikex-components/consultations/model`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
type RegistrationKind = 'consultation' | 'partner';
|
|
2
|
+
declare const registrationRegions: Record<string, string>;
|
|
3
|
+
declare const partnerTypes: Record<string, string>;
|
|
4
|
+
declare const partnerExperiences: Record<string, string>;
|
|
5
|
+
type ConsultationSubmission = {
|
|
6
|
+
kind: RegistrationKind;
|
|
7
|
+
region: string;
|
|
8
|
+
partner: string;
|
|
9
|
+
experience: string;
|
|
10
|
+
sources: string[];
|
|
11
|
+
otherSource: string;
|
|
12
|
+
submissionId: string;
|
|
13
|
+
name: string;
|
|
14
|
+
phone: string;
|
|
15
|
+
email: string;
|
|
16
|
+
city: string;
|
|
17
|
+
markets: string[];
|
|
18
|
+
otherMarket: string;
|
|
19
|
+
capital: string;
|
|
20
|
+
language: 'vi' | 'en';
|
|
21
|
+
sourcePath: string;
|
|
22
|
+
website: string;
|
|
23
|
+
};
|
|
24
|
+
declare const consultationStatuses: {
|
|
25
|
+
readonly new: "Mới";
|
|
26
|
+
readonly contacted: "Đã liên hệ";
|
|
27
|
+
readonly completed: "Hoàn tất";
|
|
28
|
+
readonly cancelled: "Không tiếp tục";
|
|
29
|
+
};
|
|
30
|
+
type ConsultationStatus = keyof typeof consultationStatuses;
|
|
31
|
+
declare const consultationCities: Record<string, string>;
|
|
32
|
+
declare const consultationCapitals: Record<string, string>;
|
|
33
|
+
type Consultation = Omit<ConsultationSubmission, 'website' | 'submissionId'> & {
|
|
34
|
+
id: string;
|
|
35
|
+
status: ConsultationStatus;
|
|
36
|
+
notes: string;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
};
|
|
40
|
+
type ConsultationList = {
|
|
41
|
+
items: Consultation[];
|
|
42
|
+
total: number;
|
|
43
|
+
page: number;
|
|
44
|
+
pageSize: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { type Consultation, type ConsultationList, type ConsultationStatus, type ConsultationSubmission, type RegistrationKind, consultationCapitals, consultationCities, consultationStatuses, partnerExperiences, partnerTypes, registrationRegions };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
type RegistrationKind = 'consultation' | 'partner';
|
|
2
|
+
declare const registrationRegions: Record<string, string>;
|
|
3
|
+
declare const partnerTypes: Record<string, string>;
|
|
4
|
+
declare const partnerExperiences: Record<string, string>;
|
|
5
|
+
type ConsultationSubmission = {
|
|
6
|
+
kind: RegistrationKind;
|
|
7
|
+
region: string;
|
|
8
|
+
partner: string;
|
|
9
|
+
experience: string;
|
|
10
|
+
sources: string[];
|
|
11
|
+
otherSource: string;
|
|
12
|
+
submissionId: string;
|
|
13
|
+
name: string;
|
|
14
|
+
phone: string;
|
|
15
|
+
email: string;
|
|
16
|
+
city: string;
|
|
17
|
+
markets: string[];
|
|
18
|
+
otherMarket: string;
|
|
19
|
+
capital: string;
|
|
20
|
+
language: 'vi' | 'en';
|
|
21
|
+
sourcePath: string;
|
|
22
|
+
website: string;
|
|
23
|
+
};
|
|
24
|
+
declare const consultationStatuses: {
|
|
25
|
+
readonly new: "Mới";
|
|
26
|
+
readonly contacted: "Đã liên hệ";
|
|
27
|
+
readonly completed: "Hoàn tất";
|
|
28
|
+
readonly cancelled: "Không tiếp tục";
|
|
29
|
+
};
|
|
30
|
+
type ConsultationStatus = keyof typeof consultationStatuses;
|
|
31
|
+
declare const consultationCities: Record<string, string>;
|
|
32
|
+
declare const consultationCapitals: Record<string, string>;
|
|
33
|
+
type Consultation = Omit<ConsultationSubmission, 'website' | 'submissionId'> & {
|
|
34
|
+
id: string;
|
|
35
|
+
status: ConsultationStatus;
|
|
36
|
+
notes: string;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
};
|
|
40
|
+
type ConsultationList = {
|
|
41
|
+
items: Consultation[];
|
|
42
|
+
total: number;
|
|
43
|
+
page: number;
|
|
44
|
+
pageSize: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { type Consultation, type ConsultationList, type ConsultationStatus, type ConsultationSubmission, type RegistrationKind, consultationCapitals, consultationCities, consultationStatuses, partnerExperiences, partnerTypes, registrationRegions };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/consultation-model.ts
|
|
21
|
+
var consultation_model_exports = {};
|
|
22
|
+
__export(consultation_model_exports, {
|
|
23
|
+
consultationCapitals: () => consultationCapitals,
|
|
24
|
+
consultationCities: () => consultationCities,
|
|
25
|
+
consultationStatuses: () => consultationStatuses,
|
|
26
|
+
partnerExperiences: () => partnerExperiences,
|
|
27
|
+
partnerTypes: () => partnerTypes,
|
|
28
|
+
registrationRegions: () => registrationRegions
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(consultation_model_exports);
|
|
31
|
+
var registrationRegions = {
|
|
32
|
+
north: "Khu v\u1EF1c mi\u1EC1n B\u1EAFc",
|
|
33
|
+
"north-central": "Khu v\u1EF1c B\u1EAFc Trung B\u1ED9",
|
|
34
|
+
central: "Khu v\u1EF1c mi\u1EC1n Trung",
|
|
35
|
+
highlands: "Khu v\u1EF1c T\xE2y Nguy\xEAn",
|
|
36
|
+
south: "Khu v\u1EF1c mi\u1EC1n Nam",
|
|
37
|
+
mekong: "Khu v\u1EF1c mi\u1EC1n T\xE2y"
|
|
38
|
+
};
|
|
39
|
+
var partnerTypes = { individual: "C\xE1 nh\xE2n", broker: "M\xF4i gi\u1EDBi t\xE0i ch\xEDnh", professional: "Chuy\xEAn vi\xEAn m\xF4i gi\u1EDBi", other: "Kh\xE1c" };
|
|
40
|
+
var partnerExperiences = { none: "Ch\u01B0a c\xF3 kinh nghi\u1EC7m", under1: "D\u01B0\u1EDBi 1 n\u0103m", oneTo3: "1\u20133 n\u0103m", over3: "Tr\xEAn 3 n\u0103m", other: "Kh\xE1c" };
|
|
41
|
+
var consultationStatuses = {
|
|
42
|
+
new: "M\u1EDBi",
|
|
43
|
+
contacted: "\u0110\xE3 li\xEAn h\u1EC7",
|
|
44
|
+
completed: "Ho\xE0n t\u1EA5t",
|
|
45
|
+
cancelled: "Kh\xF4ng ti\u1EBFp t\u1EE5c"
|
|
46
|
+
};
|
|
47
|
+
var consultationCities = { "ho-chi-minh-city": "TP. H\u1ED3 Ch\xED Minh", hanoi: "H\xE0 N\u1ED9i", other: "Kh\xE1c" };
|
|
48
|
+
var consultationCapitals = { "under-10m": "D\u01B0\u1EDBi 10 tri\u1EC7u", "10m-30m": "10\u201330 tri\u1EC7u", "30m-100m": "30\u2013100 tri\u1EC7u", "over-100m": "Tr\xEAn 100 tri\u1EC7u" };
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
consultationCapitals,
|
|
52
|
+
consultationCities,
|
|
53
|
+
consultationStatuses,
|
|
54
|
+
partnerExperiences,
|
|
55
|
+
partnerTypes,
|
|
56
|
+
registrationRegions
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=consultation-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/consultation-model.ts"],"sourcesContent":["export type RegistrationKind = 'consultation' | 'partner';\nexport const registrationRegions: Record<string, string> = {\n north: 'Khu vực miền Bắc', 'north-central': 'Khu vực Bắc Trung Bộ', central: 'Khu vực miền Trung',\n highlands: 'Khu vực Tây Nguyên', south: 'Khu vực miền Nam', mekong: 'Khu vực miền Tây',\n};\nexport const partnerTypes: Record<string, string> = { individual: 'Cá nhân', broker: 'Môi giới tài chính', professional: 'Chuyên viên môi giới', other: 'Khác' };\nexport const partnerExperiences: Record<string, string> = { none: 'Chưa có kinh nghiệm', under1: 'Dưới 1 năm', oneTo3: '1–3 năm', over3: 'Trên 3 năm', other: 'Khác' };\nexport type ConsultationSubmission = {\n kind: RegistrationKind;\n region: string;\n partner: string;\n experience: string;\n sources: string[];\n otherSource: string;\n submissionId: string;\n name: string;\n phone: string;\n email: string;\n city: string;\n markets: string[];\n otherMarket: string;\n capital: string;\n language: 'vi' | 'en';\n sourcePath: string;\n website: string;\n};\n\nexport const consultationStatuses = {\n new: 'Mới', contacted: 'Đã liên hệ', completed: 'Hoàn tất', cancelled: 'Không tiếp tục',\n} as const;\nexport type ConsultationStatus = keyof typeof consultationStatuses;\nexport const consultationCities: Record<string, string> = { 'ho-chi-minh-city': 'TP. Hồ Chí Minh', hanoi: 'Hà Nội', other: 'Khác' };\nexport const consultationCapitals: Record<string, string> = { 'under-10m': 'Dưới 10 triệu', '10m-30m': '10–30 triệu', '30m-100m': '30–100 triệu', 'over-100m': 'Trên 100 triệu' };\nexport type Consultation = Omit<ConsultationSubmission, 'website' | 'submissionId'> & {\n id: string; status: ConsultationStatus; notes: string; createdAt: string; updatedAt: string;\n};\nexport type ConsultationList = { items: Consultation[]; total: number; page: number; pageSize: number };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,IAAM,sBAA8C;AAAA,EACzD,OAAO;AAAA,EAAoB,iBAAiB;AAAA,EAAwB,SAAS;AAAA,EAC7E,WAAW;AAAA,EAAsB,OAAO;AAAA,EAAoB,QAAQ;AACtE;AACO,IAAM,eAAuC,EAAE,YAAY,iBAAW,QAAQ,oCAAsB,cAAc,sCAAwB,OAAO,UAAO;AACxJ,IAAM,qBAA6C,EAAE,MAAM,oCAAuB,QAAQ,6BAAc,QAAQ,qBAAW,OAAO,sBAAc,OAAO,UAAO;AAqB9J,IAAM,uBAAuB;AAAA,EAClC,KAAK;AAAA,EAAO,WAAW;AAAA,EAAc,WAAW;AAAA,EAAY,WAAW;AACzE;AAEO,IAAM,qBAA6C,EAAE,oBAAoB,2BAAmB,OAAO,kBAAU,OAAO,UAAO;AAC3H,IAAM,uBAA+C,EAAE,aAAa,gCAAiB,WAAW,yBAAe,YAAY,0BAAgB,aAAa,yBAAiB;","names":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/consultation-model.ts
|
|
2
|
+
var registrationRegions = {
|
|
3
|
+
north: "Khu v\u1EF1c mi\u1EC1n B\u1EAFc",
|
|
4
|
+
"north-central": "Khu v\u1EF1c B\u1EAFc Trung B\u1ED9",
|
|
5
|
+
central: "Khu v\u1EF1c mi\u1EC1n Trung",
|
|
6
|
+
highlands: "Khu v\u1EF1c T\xE2y Nguy\xEAn",
|
|
7
|
+
south: "Khu v\u1EF1c mi\u1EC1n Nam",
|
|
8
|
+
mekong: "Khu v\u1EF1c mi\u1EC1n T\xE2y"
|
|
9
|
+
};
|
|
10
|
+
var partnerTypes = { individual: "C\xE1 nh\xE2n", broker: "M\xF4i gi\u1EDBi t\xE0i ch\xEDnh", professional: "Chuy\xEAn vi\xEAn m\xF4i gi\u1EDBi", other: "Kh\xE1c" };
|
|
11
|
+
var partnerExperiences = { none: "Ch\u01B0a c\xF3 kinh nghi\u1EC7m", under1: "D\u01B0\u1EDBi 1 n\u0103m", oneTo3: "1\u20133 n\u0103m", over3: "Tr\xEAn 3 n\u0103m", other: "Kh\xE1c" };
|
|
12
|
+
var consultationStatuses = {
|
|
13
|
+
new: "M\u1EDBi",
|
|
14
|
+
contacted: "\u0110\xE3 li\xEAn h\u1EC7",
|
|
15
|
+
completed: "Ho\xE0n t\u1EA5t",
|
|
16
|
+
cancelled: "Kh\xF4ng ti\u1EBFp t\u1EE5c"
|
|
17
|
+
};
|
|
18
|
+
var consultationCities = { "ho-chi-minh-city": "TP. H\u1ED3 Ch\xED Minh", hanoi: "H\xE0 N\u1ED9i", other: "Kh\xE1c" };
|
|
19
|
+
var consultationCapitals = { "under-10m": "D\u01B0\u1EDBi 10 tri\u1EC7u", "10m-30m": "10\u201330 tri\u1EC7u", "30m-100m": "30\u2013100 tri\u1EC7u", "over-100m": "Tr\xEAn 100 tri\u1EC7u" };
|
|
20
|
+
export {
|
|
21
|
+
consultationCapitals,
|
|
22
|
+
consultationCities,
|
|
23
|
+
consultationStatuses,
|
|
24
|
+
partnerExperiences,
|
|
25
|
+
partnerTypes,
|
|
26
|
+
registrationRegions
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=consultation-model.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/consultation-model.ts"],"sourcesContent":["export type RegistrationKind = 'consultation' | 'partner';\nexport const registrationRegions: Record<string, string> = {\n north: 'Khu vực miền Bắc', 'north-central': 'Khu vực Bắc Trung Bộ', central: 'Khu vực miền Trung',\n highlands: 'Khu vực Tây Nguyên', south: 'Khu vực miền Nam', mekong: 'Khu vực miền Tây',\n};\nexport const partnerTypes: Record<string, string> = { individual: 'Cá nhân', broker: 'Môi giới tài chính', professional: 'Chuyên viên môi giới', other: 'Khác' };\nexport const partnerExperiences: Record<string, string> = { none: 'Chưa có kinh nghiệm', under1: 'Dưới 1 năm', oneTo3: '1–3 năm', over3: 'Trên 3 năm', other: 'Khác' };\nexport type ConsultationSubmission = {\n kind: RegistrationKind;\n region: string;\n partner: string;\n experience: string;\n sources: string[];\n otherSource: string;\n submissionId: string;\n name: string;\n phone: string;\n email: string;\n city: string;\n markets: string[];\n otherMarket: string;\n capital: string;\n language: 'vi' | 'en';\n sourcePath: string;\n website: string;\n};\n\nexport const consultationStatuses = {\n new: 'Mới', contacted: 'Đã liên hệ', completed: 'Hoàn tất', cancelled: 'Không tiếp tục',\n} as const;\nexport type ConsultationStatus = keyof typeof consultationStatuses;\nexport const consultationCities: Record<string, string> = { 'ho-chi-minh-city': 'TP. Hồ Chí Minh', hanoi: 'Hà Nội', other: 'Khác' };\nexport const consultationCapitals: Record<string, string> = { 'under-10m': 'Dưới 10 triệu', '10m-30m': '10–30 triệu', '30m-100m': '30–100 triệu', 'over-100m': 'Trên 100 triệu' };\nexport type Consultation = Omit<ConsultationSubmission, 'website' | 'submissionId'> & {\n id: string; status: ConsultationStatus; notes: string; createdAt: string; updatedAt: string;\n};\nexport type ConsultationList = { items: Consultation[]; total: number; page: number; pageSize: number };\n"],"mappings":";AACO,IAAM,sBAA8C;AAAA,EACzD,OAAO;AAAA,EAAoB,iBAAiB;AAAA,EAAwB,SAAS;AAAA,EAC7E,WAAW;AAAA,EAAsB,OAAO;AAAA,EAAoB,QAAQ;AACtE;AACO,IAAM,eAAuC,EAAE,YAAY,iBAAW,QAAQ,oCAAsB,cAAc,sCAAwB,OAAO,UAAO;AACxJ,IAAM,qBAA6C,EAAE,MAAM,oCAAuB,QAAQ,6BAAc,QAAQ,qBAAW,OAAO,sBAAc,OAAO,UAAO;AAqB9J,IAAM,uBAAuB;AAAA,EAClC,KAAK;AAAA,EAAO,WAAW;AAAA,EAAc,WAAW;AAAA,EAAY,WAAW;AACzE;AAEO,IAAM,qBAA6C,EAAE,oBAAoB,2BAAmB,OAAO,kBAAU,OAAO,UAAO;AAC3H,IAAM,uBAA+C,EAAE,aAAa,gCAAiB,WAAW,yBAAe,YAAY,0BAAgB,aAAa,yBAAiB;","names":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ConsultationList, ConsultationStatus, Consultation } from './consultation-model.mjs';
|
|
3
|
+
export { ConsultationSubmission, RegistrationKind } from './consultation-model.mjs';
|
|
4
|
+
|
|
5
|
+
type ConsultationManagerProps = {
|
|
6
|
+
kind?: 'consultation' | 'partner';
|
|
7
|
+
data: ConsultationList;
|
|
8
|
+
search: string;
|
|
9
|
+
status: ConsultationStatus | '';
|
|
10
|
+
loading: boolean;
|
|
11
|
+
busy: boolean;
|
|
12
|
+
canWrite: boolean;
|
|
13
|
+
notice: {
|
|
14
|
+
severity: 'success' | 'error';
|
|
15
|
+
message: string;
|
|
16
|
+
} | null;
|
|
17
|
+
onSearch: (value: string) => void;
|
|
18
|
+
onStatus: (value: ConsultationStatus | '') => void;
|
|
19
|
+
onPage: (page: number) => void;
|
|
20
|
+
onPageSize: (size: number) => void;
|
|
21
|
+
onReload: () => void;
|
|
22
|
+
onSave: (item: Consultation, status: ConsultationStatus, notes: string) => Promise<void>;
|
|
23
|
+
onDelete: (item: Consultation) => Promise<void>;
|
|
24
|
+
onDismissNotice: () => void;
|
|
25
|
+
};
|
|
26
|
+
declare function ConsultationManager({ kind, data, search, status, loading, busy, canWrite, notice, onSearch, onStatus, onPage, onPageSize, onReload, onSave, onDelete, onDismissNotice }: ConsultationManagerProps): react.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { Consultation, ConsultationList, ConsultationManager, type ConsultationManagerProps, ConsultationStatus };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ConsultationList, ConsultationStatus, Consultation } from './consultation-model.js';
|
|
3
|
+
export { ConsultationSubmission, RegistrationKind } from './consultation-model.js';
|
|
4
|
+
|
|
5
|
+
type ConsultationManagerProps = {
|
|
6
|
+
kind?: 'consultation' | 'partner';
|
|
7
|
+
data: ConsultationList;
|
|
8
|
+
search: string;
|
|
9
|
+
status: ConsultationStatus | '';
|
|
10
|
+
loading: boolean;
|
|
11
|
+
busy: boolean;
|
|
12
|
+
canWrite: boolean;
|
|
13
|
+
notice: {
|
|
14
|
+
severity: 'success' | 'error';
|
|
15
|
+
message: string;
|
|
16
|
+
} | null;
|
|
17
|
+
onSearch: (value: string) => void;
|
|
18
|
+
onStatus: (value: ConsultationStatus | '') => void;
|
|
19
|
+
onPage: (page: number) => void;
|
|
20
|
+
onPageSize: (size: number) => void;
|
|
21
|
+
onReload: () => void;
|
|
22
|
+
onSave: (item: Consultation, status: ConsultationStatus, notes: string) => Promise<void>;
|
|
23
|
+
onDelete: (item: Consultation) => Promise<void>;
|
|
24
|
+
onDismissNotice: () => void;
|
|
25
|
+
};
|
|
26
|
+
declare function ConsultationManager({ kind, data, search, status, loading, busy, canWrite, notice, onSearch, onStatus, onPage, onPageSize, onReload, onSave, onDelete, onDismissNotice }: ConsultationManagerProps): react.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { Consultation, ConsultationList, ConsultationManager, type ConsultationManagerProps, ConsultationStatus };
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/consultations.ts
|
|
22
|
+
var consultations_exports = {};
|
|
23
|
+
__export(consultations_exports, {
|
|
24
|
+
ConsultationManager: () => ConsultationManager
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(consultations_exports);
|
|
27
|
+
|
|
28
|
+
// src/wikex/consultation-manager.tsx
|
|
29
|
+
var import_react = require("react");
|
|
30
|
+
var import_material = require("@mui/material");
|
|
31
|
+
|
|
32
|
+
// src/consultation-model.ts
|
|
33
|
+
var registrationRegions = {
|
|
34
|
+
north: "Khu v\u1EF1c mi\u1EC1n B\u1EAFc",
|
|
35
|
+
"north-central": "Khu v\u1EF1c B\u1EAFc Trung B\u1ED9",
|
|
36
|
+
central: "Khu v\u1EF1c mi\u1EC1n Trung",
|
|
37
|
+
highlands: "Khu v\u1EF1c T\xE2y Nguy\xEAn",
|
|
38
|
+
south: "Khu v\u1EF1c mi\u1EC1n Nam",
|
|
39
|
+
mekong: "Khu v\u1EF1c mi\u1EC1n T\xE2y"
|
|
40
|
+
};
|
|
41
|
+
var partnerTypes = { individual: "C\xE1 nh\xE2n", broker: "M\xF4i gi\u1EDBi t\xE0i ch\xEDnh", professional: "Chuy\xEAn vi\xEAn m\xF4i gi\u1EDBi", other: "Kh\xE1c" };
|
|
42
|
+
var partnerExperiences = { none: "Ch\u01B0a c\xF3 kinh nghi\u1EC7m", under1: "D\u01B0\u1EDBi 1 n\u0103m", oneTo3: "1\u20133 n\u0103m", over3: "Tr\xEAn 3 n\u0103m", other: "Kh\xE1c" };
|
|
43
|
+
var consultationStatuses = {
|
|
44
|
+
new: "M\u1EDBi",
|
|
45
|
+
contacted: "\u0110\xE3 li\xEAn h\u1EC7",
|
|
46
|
+
completed: "Ho\xE0n t\u1EA5t",
|
|
47
|
+
cancelled: "Kh\xF4ng ti\u1EBFp t\u1EE5c"
|
|
48
|
+
};
|
|
49
|
+
var consultationCities = { "ho-chi-minh-city": "TP. H\u1ED3 Ch\xED Minh", hanoi: "H\xE0 N\u1ED9i", other: "Kh\xE1c" };
|
|
50
|
+
var consultationCapitals = { "under-10m": "D\u01B0\u1EDBi 10 tri\u1EC7u", "10m-30m": "10\u201330 tri\u1EC7u", "30m-100m": "30\u2013100 tri\u1EC7u", "over-100m": "Tr\xEAn 100 tri\u1EC7u" };
|
|
51
|
+
|
|
52
|
+
// src/wikex/consultation-manager.tsx
|
|
53
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
54
|
+
var date = (value) => new Intl.DateTimeFormat("vi-VN", { timeZone: "Asia/Ho_Chi_Minh", dateStyle: "short", timeStyle: "short" }).format(new Date(value));
|
|
55
|
+
var city = (value) => consultationCities[value] || value || "Ch\u01B0a cung c\u1EA5p";
|
|
56
|
+
var capital = (value) => consultationCapitals[value] || value || "Ch\u01B0a cung c\u1EA5p";
|
|
57
|
+
function ConsultationManager({
|
|
58
|
+
kind = "consultation",
|
|
59
|
+
data,
|
|
60
|
+
search,
|
|
61
|
+
status,
|
|
62
|
+
loading,
|
|
63
|
+
busy,
|
|
64
|
+
canWrite,
|
|
65
|
+
notice,
|
|
66
|
+
onSearch,
|
|
67
|
+
onStatus,
|
|
68
|
+
onPage,
|
|
69
|
+
onPageSize,
|
|
70
|
+
onReload,
|
|
71
|
+
onSave,
|
|
72
|
+
onDelete,
|
|
73
|
+
onDismissNotice
|
|
74
|
+
}) {
|
|
75
|
+
const isPartner = kind === "partner";
|
|
76
|
+
const title = isPartner ? "\u0110\u0103ng k\xFD \u0111\u1ED1i t\xE1c \u2014 Wikex VN" : "\u0110\u0103ng k\xFD t\u01B0 v\u1EA5n \u2014 Trang ch\u1EE7";
|
|
77
|
+
const [editing, setEditing] = (0, import_react.useState)(null);
|
|
78
|
+
const [deleting, setDeleting] = (0, import_react.useState)(null);
|
|
79
|
+
const [draftStatus, setDraftStatus] = (0, import_react.useState)("new");
|
|
80
|
+
const [notes, setNotes] = (0, import_react.useState)("");
|
|
81
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { spacing: 3, sx: { minWidth: 0 }, children: [
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { direction: { xs: "column", sm: "row" }, gap: 2, justifyContent: "space-between", alignItems: { sm: "center" }, children: [
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { spacing: 1, children: [
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "h4", children: title }),
|
|
85
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "body2", color: "text.secondary", children: "Th\xF4ng tin t\u1EEB form \u0111\u0103ng k\xFD tr\xEAn website. Theo d\xF5i li\xEAn h\u1EC7 v\xE0 ghi ch\xFA x\u1EED l\xFD." })
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { variant: "outlined", disabled: loading || busy, onClick: onReload, children: "T\u1EA3i l\u1EA1i danh s\xE1ch" })
|
|
88
|
+
] }),
|
|
89
|
+
!canWrite && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Alert, { severity: "info", children: "B\u1EA1n c\xF3 quy\u1EC1n xem \u0111\u0103ng k\xFD. C\u1EA7n quy\u1EC1n ch\u1EC9nh s\u1EEDa \u0111\u0103ng k\xFD \u0111\u1EC3 c\u1EADp nh\u1EADt ho\u1EB7c x\xF3a." }),
|
|
90
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Alert, { severity: notice.severity, onClose: onDismissNotice, children: notice.message }),
|
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Card, { sx: { p: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { direction: { xs: "column", sm: "row" }, spacing: 2, children: [
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TextField, { size: "small", fullWidth: true, label: "T\xECm theo t\xEAn, \u0111i\u1EC7n tho\u1EA1i ho\u1EB7c email", value: search, disabled: busy, onChange: (event) => onSearch(event.target.value) }),
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.TextField, { select: true, size: "small", label: "Tr\u1EA1ng th\xE1i", value: status, disabled: busy, sx: { minWidth: 200 }, onChange: (event) => onStatus(event.target.value), children: [
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.MenuItem, { value: "", children: "T\u1EA5t c\u1EA3" }),
|
|
95
|
+
Object.entries(consultationStatuses).map(([key, label]) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.MenuItem, { value: key, children: label }, key))
|
|
96
|
+
] })
|
|
97
|
+
] }) }),
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Card, { "aria-busy": loading, sx: { opacity: loading ? 0.65 : 1 }, children: [
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Box, { sx: { overflowX: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Table, { "aria-label": title, sx: { minWidth: 1050 }, children: [
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableRow, { children: ["Kh\xE1ch h\xE0ng", "\u0110i\u1EC7n tho\u1EA1i / Email", "Khu v\u1EF1c", isPartner ? "\u0110\u1ED1i t\xE1c / Kinh nghi\u1EC7m" : "Th\u1ECB tr\u01B0\u1EDDng / V\u1ED1n", "Tr\u1EA1ng th\xE1i", "Ng\xE0y g\u1EEDi", "Thao t\xE1c"].map((title2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableCell, { children: title2 }, title2)) }) }),
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.TableBody, { children: [
|
|
102
|
+
data.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.TableRow, { children: [
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.TableCell, { sx: { maxWidth: 220, overflowWrap: "anywhere" }, children: [
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "subtitle2", children: item.name }),
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "caption", color: "text.secondary", children: item.language.toUpperCase() })
|
|
106
|
+
] }),
|
|
107
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.TableCell, { sx: { maxWidth: 260, overflowWrap: "anywhere" }, children: [
|
|
108
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "body2", children: item.phone }),
|
|
109
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "body2", color: "text.secondary", children: item.email })
|
|
110
|
+
] }),
|
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableCell, { children: isPartner ? registrationRegions[item.region] || "Ch\u01B0a cung c\u1EA5p" : city(item.city) }),
|
|
112
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableCell, { sx: { maxWidth: 220, overflowWrap: "anywhere" }, children: isPartner ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "body2", children: partnerTypes[item.partner] || "Ch\u01B0a cung c\u1EA5p" }),
|
|
114
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "caption", children: partnerExperiences[item.experience] || "Ch\u01B0a cung c\u1EA5p" })
|
|
115
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "body2", children: item.markets.join(", ") || "Ch\u01B0a cung c\u1EA5p" }),
|
|
117
|
+
item.otherMarket && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Typography, { variant: "body2", children: [
|
|
118
|
+
"Kh\xE1c: ",
|
|
119
|
+
item.otherMarket
|
|
120
|
+
] }),
|
|
121
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "caption", color: "text.secondary", children: capital(item.capital) })
|
|
122
|
+
] }) }),
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Chip, { size: "small", label: consultationStatuses[item.status], color: item.status === "new" ? "warning" : item.status === "completed" ? "success" : "default" }) }),
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableCell, { sx: { whiteSpace: "nowrap" }, children: date(item.createdAt) }),
|
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { direction: "row", spacing: 1, children: [
|
|
126
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { size: "small", disabled: busy, onClick: () => {
|
|
127
|
+
setEditing(item);
|
|
128
|
+
setDraftStatus(item.status);
|
|
129
|
+
setNotes(item.notes);
|
|
130
|
+
}, children: "Xem / x\u1EED l\xFD" }),
|
|
131
|
+
canWrite && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { size: "small", color: "error", disabled: busy, onClick: () => setDeleting(item), children: "X\xF3a" })
|
|
132
|
+
] }) })
|
|
133
|
+
] }, item.id)),
|
|
134
|
+
!data.items.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TableCell, { colSpan: 7, align: "center", sx: { py: 6 }, children: loading ? "\u0110ang t\u1EA3i \u0111\u0103ng k\xFD\u2026" : "Ch\u01B0a c\xF3 \u0111\u0103ng k\xFD ph\xF9 h\u1EE3p." }) })
|
|
135
|
+
] })
|
|
136
|
+
] }) }),
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
138
|
+
import_material.TablePagination,
|
|
139
|
+
{
|
|
140
|
+
component: "div",
|
|
141
|
+
count: data.total,
|
|
142
|
+
page: data.page - 1,
|
|
143
|
+
rowsPerPage: data.pageSize,
|
|
144
|
+
rowsPerPageOptions: [10, 25, 50, 100],
|
|
145
|
+
labelRowsPerPage: "S\u1ED1 d\xF2ng m\u1ED7i trang",
|
|
146
|
+
labelDisplayedRows: ({ from, to, count }) => `${from}\u2013${to} / ${count}`,
|
|
147
|
+
onPageChange: (_, next) => onPage(next + 1),
|
|
148
|
+
onRowsPerPageChange: (event) => onPageSize(Number(event.target.value)),
|
|
149
|
+
disabled: loading || busy,
|
|
150
|
+
slotProps: { select: { native: false }, actions: { previousButton: { "aria-label": "Trang tr\u01B0\u1EDBc" }, nextButton: { "aria-label": "Trang sau" } } }
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
] }),
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
155
|
+
import_material.Dialog,
|
|
156
|
+
{
|
|
157
|
+
open: Boolean(editing),
|
|
158
|
+
onClose: () => !busy && setEditing(null),
|
|
159
|
+
fullWidth: true,
|
|
160
|
+
maxWidth: "md",
|
|
161
|
+
"aria-labelledby": "registration-detail-title",
|
|
162
|
+
slotProps: { paper: { sx: { borderRadius: 3, m: { xs: 1.5, sm: 4 }, width: { xs: "calc(100% - 24px)", sm: "100%" }, maxHeight: "calc(100% - 32px)" } } },
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.DialogTitle, { id: "registration-detail-title", sx: { px: { xs: 2.5, sm: 3 }, pt: 3, pb: 2 }, children: [
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { component: "span", variant: "overline", color: "text.secondary", children: isPartner ? "\u0110\u0103ng k\xFD \u0111\u1ED1i t\xE1c" : "\u0110\u0103ng k\xFD t\u01B0 v\u1EA5n" }),
|
|
166
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { direction: "row", spacing: 2, alignItems: "center", sx: { mt: 1 }, children: [
|
|
167
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Avatar, { sx: { width: 52, height: 52, bgcolor: "primary.lighter", color: "primary.dark", fontWeight: 700 }, children: editing?.name.trim().split(/\s+/).slice(-2).map((part) => part[0]).join("").toUpperCase() }),
|
|
168
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Box, { sx: { minWidth: 0, flex: 1 }, children: [
|
|
169
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { component: "span", variant: "h5", sx: { display: "block", overflowWrap: "anywhere" }, children: editing?.name }),
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Typography, { component: "span", variant: "body2", color: "text.secondary", children: [
|
|
171
|
+
isPartner ? "Wikex VN" : "Trang ch\u1EE7",
|
|
172
|
+
" \xB7 ",
|
|
173
|
+
editing && date(editing.createdAt)
|
|
174
|
+
] })
|
|
175
|
+
] })
|
|
176
|
+
] })
|
|
177
|
+
] }),
|
|
178
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.DialogContent, { dividers: true, sx: { px: { xs: 2.5, sm: 3 }, py: 3, bgcolor: "background.neutral" }, children: [
|
|
179
|
+
notice?.severity === "error" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Alert, { severity: "error", sx: { mb: 2 }, children: notice.message }),
|
|
180
|
+
editing && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Box, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", md: "minmax(0, 1.2fr) minmax(0, 1fr)" }, gap: 2.5 }, children: [
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { spacing: 2.5, sx: { minWidth: 0 }, children: [
|
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Card, { variant: "outlined", sx: { p: 2.5, boxShadow: "none" }, children: [
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "subtitle1", sx: { mb: 2 }, children: "Th\xF4ng tin li\xEAn h\u1EC7" }),
|
|
184
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Box, { component: "dl", sx: { m: 0, display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr" }, gap: 2 }, children: [
|
|
185
|
+
{ label: "\u0110i\u1EC7n tho\u1EA1i", value: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Link, { href: `tel:${editing.phone.replace(/[^+0-9]/g, "")}`, underline: "hover", color: "text.primary", children: editing.phone }) },
|
|
186
|
+
{ label: "Khu v\u1EF1c", value: isPartner ? registrationRegions[editing.region] || "Ch\u01B0a cung c\u1EA5p" : city(editing.city) },
|
|
187
|
+
{ label: "Email", value: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Link, { href: `mailto:${editing.email}`, underline: "hover", color: "text.primary", children: editing.email }), full: true }
|
|
188
|
+
].map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Box, { sx: { minWidth: 0, gridColumn: field.full ? "1 / -1" : void 0 }, children: [
|
|
189
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { component: "dt", variant: "caption", color: "text.secondary", sx: { mb: 0.5 }, children: field.label }),
|
|
190
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { component: "dd", variant: "body2", sx: { m: 0, fontWeight: 600, overflowWrap: "anywhere" }, children: field.value })
|
|
191
|
+
] }, field.label)) })
|
|
192
|
+
] }),
|
|
193
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Card, { variant: "outlined", sx: { p: 2.5, boxShadow: "none" }, children: [
|
|
194
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "subtitle1", sx: { mb: 2 }, children: isPartner ? "Th\xF4ng tin h\u1EE3p t\xE1c" : "Nhu c\u1EA7u t\u01B0 v\u1EA5n" }),
|
|
195
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Box, { component: "dl", sx: { m: 0, display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr" }, gap: 2 }, children: [
|
|
196
|
+
(isPartner ? [
|
|
197
|
+
{ label: "\u0110\u1ED1i t\xE1c", value: partnerTypes[editing.partner] || "Ch\u01B0a cung c\u1EA5p" },
|
|
198
|
+
{ label: "Kinh nghi\u1EC7m", value: partnerExperiences[editing.experience] || "Ch\u01B0a cung c\u1EA5p" }
|
|
199
|
+
] : [{ label: "S\u1ED1 v\u1ED1n d\u1EF1 ki\u1EBFn", value: capital(editing.capital) }]).map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Box, { children: [
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { component: "dt", variant: "caption", color: "text.secondary", sx: { mb: 0.5 }, children: field.label }),
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { component: "dd", variant: "body2", sx: { m: 0, fontWeight: 600, overflowWrap: "anywhere" }, children: field.value })
|
|
202
|
+
] }, field.label)),
|
|
203
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Box, { sx: { gridColumn: "1 / -1", minWidth: 0 }, children: [
|
|
204
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { component: "dt", variant: "caption", color: "text.secondary", sx: { mb: 1 }, children: isPartner ? "K\xEAnh \u0111ang c\xF3 s\u1EB5n" : "Th\u1ECB tr\u01B0\u1EDDng quan t\xE2m" }),
|
|
205
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Stack, { component: "dd", direction: "row", flexWrap: "wrap", gap: 0.75, sx: { m: 0 }, children: (isPartner ? editing.sources : editing.markets).length ? (isPartner ? editing.sources : editing.markets).map(
|
|
206
|
+
(value, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Chip, { label: value, size: "small", variant: "outlined", sx: { maxWidth: "100%", height: "auto", "& .MuiChip-label": { whiteSpace: "normal", py: 0.5, overflowWrap: "anywhere" } } }, `${value}-${index}`)
|
|
207
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "body2", color: "text.secondary", children: "Ch\u01B0a cung c\u1EA5p" }) }),
|
|
208
|
+
(isPartner ? editing.otherSource : editing.otherMarket) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Typography, { variant: "body2", sx: { mt: 1, overflowWrap: "anywhere" }, children: [
|
|
209
|
+
"Kh\xE1c: ",
|
|
210
|
+
isPartner ? editing.otherSource : editing.otherMarket
|
|
211
|
+
] })
|
|
212
|
+
] })
|
|
213
|
+
] }),
|
|
214
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Divider, { sx: { my: 2 } }),
|
|
215
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { spacing: 0.5, children: [
|
|
216
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Typography, { variant: "caption", color: "text.secondary", children: [
|
|
217
|
+
"Trang g\u1EEDi: ",
|
|
218
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Box, { component: "span", sx: { overflowWrap: "anywhere" }, children: editing.sourcePath })
|
|
219
|
+
] }),
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Typography, { variant: "caption", color: "text.secondary", children: [
|
|
221
|
+
"Ng\xF4n ng\u1EEF: ",
|
|
222
|
+
editing.language === "en" ? "Ti\u1EBFng Anh" : "Ti\u1EBFng Vi\u1EC7t"
|
|
223
|
+
] })
|
|
224
|
+
] })
|
|
225
|
+
] })
|
|
226
|
+
] }),
|
|
227
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Card, { variant: "outlined", sx: { p: 2.5, boxShadow: "none", alignSelf: "start", minWidth: 0 }, children: [
|
|
228
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { direction: "row", gap: 1, justifyContent: "space-between", alignItems: "center", sx: { mb: 1 }, children: [
|
|
229
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "subtitle1", children: "X\u1EED l\xFD \u0111\u0103ng k\xFD" }),
|
|
230
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Chip, { size: "small", label: consultationStatuses[draftStatus], color: draftStatus === "new" ? "warning" : draftStatus === "completed" ? "success" : draftStatus === "contacted" ? "info" : "default" })
|
|
231
|
+
] }),
|
|
232
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "body2", color: "text.secondary", sx: { mb: 3 }, children: "C\u1EADp nh\u1EADt ti\u1EBFn \u0111\u1ED9 li\xEAn h\u1EC7 v\xE0 ghi ch\xFA cho \u0111\u1ED9i ng\u0169." }),
|
|
233
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { spacing: 2.5, children: [
|
|
234
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.TextField, { fullWidth: true, select: true, label: "Tr\u1EA1ng th\xE1i x\u1EED l\xFD", value: draftStatus, disabled: busy || !canWrite, onChange: (event) => setDraftStatus(event.target.value), children: Object.entries(consultationStatuses).map(([key, label]) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.MenuItem, { value: key, children: label }, key)) }),
|
|
235
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
236
|
+
import_material.TextField,
|
|
237
|
+
{
|
|
238
|
+
fullWidth: true,
|
|
239
|
+
label: "Ghi ch\xFA n\u1ED9i b\u1ED9",
|
|
240
|
+
placeholder: "N\u1ED9i dung trao \u0111\u1ED5i, nhu c\u1EA7u v\xE0 l\u1ECBch h\u1EB9n ti\u1EBFp theo\u2026",
|
|
241
|
+
value: notes,
|
|
242
|
+
disabled: busy || !canWrite,
|
|
243
|
+
multiline: true,
|
|
244
|
+
minRows: 5,
|
|
245
|
+
inputProps: { maxLength: 5e3 },
|
|
246
|
+
helperText: `${notes.length.toLocaleString("vi-VN")} / 5.000 k\xFD t\u1EF1 \xB7 Ch\u1EC9 hi\u1EC3n th\u1ECB trong CMS`,
|
|
247
|
+
onChange: (event) => setNotes(event.target.value)
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
!canWrite && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "caption", color: "text.secondary", children: "B\u1EA1n ch\u1EC9 c\xF3 quy\u1EC1n xem th\xF4ng tin \u0111\u0103ng k\xFD." })
|
|
251
|
+
] })
|
|
252
|
+
] })
|
|
253
|
+
] })
|
|
254
|
+
] }),
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.DialogActions, { sx: { px: { xs: 2.5, sm: 3 }, py: 2, gap: 1 }, children: [
|
|
256
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { disabled: busy, onClick: () => setEditing(null), children: "\u0110\xF3ng" }),
|
|
257
|
+
canWrite && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { variant: "contained", loading: busy, disabled: busy, onClick: async () => {
|
|
258
|
+
if (!editing) return;
|
|
259
|
+
try {
|
|
260
|
+
await onSave(editing, draftStatus, notes);
|
|
261
|
+
setEditing(null);
|
|
262
|
+
} catch {
|
|
263
|
+
}
|
|
264
|
+
}, children: "L\u01B0u x\u1EED l\xFD" })
|
|
265
|
+
] })
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
),
|
|
269
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Dialog, { open: Boolean(deleting), onClose: () => !busy && setDeleting(null), children: [
|
|
270
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.DialogTitle, { children: "X\xF3a \u0111\u0103ng k\xFD?" }),
|
|
271
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.DialogContent, { children: [
|
|
272
|
+
notice?.severity === "error" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Alert, { severity: "error", sx: { mb: 2 }, children: notice.message }),
|
|
273
|
+
"Th\xF4ng tin \u0111\u0103ng k\xFD c\u1EE7a ",
|
|
274
|
+
deleting?.name,
|
|
275
|
+
" s\u1EBD b\u1ECB x\xF3a v\u0129nh vi\u1EC5n."
|
|
276
|
+
] }),
|
|
277
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.DialogActions, { children: [
|
|
278
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { disabled: busy, onClick: () => setDeleting(null), children: "H\u1EE7y" }),
|
|
279
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Button, { color: "error", disabled: busy, onClick: async () => {
|
|
280
|
+
if (!deleting) return;
|
|
281
|
+
try {
|
|
282
|
+
await onDelete(deleting);
|
|
283
|
+
setDeleting(null);
|
|
284
|
+
} catch {
|
|
285
|
+
}
|
|
286
|
+
}, children: "X\xF3a \u0111\u0103ng k\xFD" })
|
|
287
|
+
] })
|
|
288
|
+
] })
|
|
289
|
+
] });
|
|
290
|
+
}
|
|
291
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
292
|
+
0 && (module.exports = {
|
|
293
|
+
ConsultationManager
|
|
294
|
+
});
|
|
295
|
+
//# sourceMappingURL=consultations.js.map
|