@appcorp/fusion-storybook 0.1.100 → 0.1.101
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/base-modules/admission/context.js +4 -3
- package/base-modules/admission/view.js +2 -2
- package/base-modules/campus/context.js +3 -2
- package/base-modules/campus/view.js +5 -3
- package/base-modules/class/view.js +4 -2
- package/base-modules/course/view.js +4 -2
- package/base-modules/discount-code/view.js +1 -1
- package/base-modules/expense/view.js +6 -4
- package/base-modules/family/view.js +1 -1
- package/base-modules/family-member/context.js +4 -3
- package/base-modules/family-member/view.js +7 -4
- package/base-modules/fee-structure/view.js +4 -2
- package/base-modules/school/context.js +3 -2
- package/base-modules/school/view.js +2 -2
- package/base-modules/section/view.js +4 -2
- package/base-modules/student-profile/context.js +4 -3
- package/base-modules/student-profile/view.js +2 -2
- package/base-modules/subject/view.js +4 -2
- package/base-modules/teacher/context.js +4 -3
- package/base-modules/teacher/view.js +2 -2
- package/base-modules/user/context.js +3 -2
- package/base-modules/user/view.js +2 -2
- package/base-modules/workspace/view.js +1 -1
- package/base-modules/workspace-user/view.js +1 -1
- package/package.json +3 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/admission-pdf.js +2 -6
- package/utils/format-value.d.ts +0 -1
- package/utils/format-value.js +3 -1
- package/utils/phone-helpers.d.ts +0 -2
- package/utils/phone-helpers.js +26 -28
- package/utils/clear-cache.d.ts +0 -1
- package/utils/clear-cache.js +0 -8
|
@@ -33,7 +33,8 @@ import { admissionFormValidation } from "./validate";
|
|
|
33
33
|
import { getCachedAdmissions, invalidateAdmissionsCache } from "./cache";
|
|
34
34
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
35
35
|
import { generateAdmissionReceiptPDF, } from "../../utils/admission-pdf";
|
|
36
|
-
import {
|
|
36
|
+
import { formatNumber } from "@react-pakistan/util-functions/general/format-number";
|
|
37
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
37
38
|
import { invalidateFamiliesCache } from "../family/cache";
|
|
38
39
|
import { invalidateFamilyMembersCache } from "../family-member/cache";
|
|
39
40
|
import { invalidateStudentProfilesCache } from "../student-profile/cache";
|
|
@@ -179,7 +180,7 @@ export const useAdmissionModule = () => {
|
|
|
179
180
|
fatherIdNumber: state.fatherIdNumber || "",
|
|
180
181
|
fatherFirstName: state.fatherFirstName || "",
|
|
181
182
|
fatherLastName: state.fatherLastName || "",
|
|
182
|
-
fatherMobile:
|
|
183
|
+
fatherMobile: formatNumber(state.fatherMobile),
|
|
183
184
|
fatherOccupation: state.fatherOccupation || "",
|
|
184
185
|
fatherOrganization: state.fatherOrganization || "",
|
|
185
186
|
firstName: state.firstName || "",
|
|
@@ -190,7 +191,7 @@ export const useAdmissionModule = () => {
|
|
|
190
191
|
motherIdNumber: state.motherIdNumber || "",
|
|
191
192
|
motherFirstName: state.motherFirstName || "",
|
|
192
193
|
motherLastName: state.motherLastName || "",
|
|
193
|
-
motherMobile:
|
|
194
|
+
motherMobile: formatNumber(state.motherMobile),
|
|
194
195
|
notes: state.notes || "",
|
|
195
196
|
orphan: (_c = state.orphan) !== null && _c !== void 0 ? _c : false,
|
|
196
197
|
postalCode: state.postalCode || "",
|
|
@@ -16,8 +16,8 @@ import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
|
16
16
|
import { AlertTriangle, BookOpen, Brain, Calendar, CheckCircle2, FileText, Home, Loader2, RefreshCw, ShieldCheck, ShieldX, User, XCircle, } from "lucide-react";
|
|
17
17
|
import { Button } from "@appcorp/shadcn/components/ui/button";
|
|
18
18
|
import { useTranslations } from "next-intl";
|
|
19
|
-
import { formatValue } from "
|
|
20
|
-
import { formatPhoneDisplay } from "
|
|
19
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
20
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
21
21
|
import { formatDate, DATE_FORMATS } from "@react-pakistan/util-functions";
|
|
22
22
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
23
23
|
import { ADMISSION_STATUS } from "../../type";
|
|
@@ -21,7 +21,8 @@ import { useDebounce } from "@react-pakistan/util-functions/hooks/use-debounce";
|
|
|
21
21
|
import { createGenericModule } from "@react-pakistan/util-functions/factory/generic-module-factory";
|
|
22
22
|
import { DRAWER_TYPES } from "@react-pakistan/util-functions/factory/generic-component-factory";
|
|
23
23
|
import { generateThemeToast, TOAST_VARIANT, } from "@appcorp/shadcn/lib/toast-utils";
|
|
24
|
-
import {
|
|
24
|
+
import { formatNumber } from "@react-pakistan/util-functions/general/format-number";
|
|
25
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
25
26
|
import { CAMPUS_API_ROUTES, pageLimit } from "./constants";
|
|
26
27
|
import { campusFormValidation } from "./validate";
|
|
27
28
|
import { getCachedCampuses, invalidateCampusesCache } from "./cache";
|
|
@@ -107,7 +108,7 @@ export const useCampusModule = () => {
|
|
|
107
108
|
enabled: state.enabled,
|
|
108
109
|
id: state.id,
|
|
109
110
|
name: state.name,
|
|
110
|
-
phone:
|
|
111
|
+
phone: formatNumber(state.phone),
|
|
111
112
|
schoolId: state.schoolId || schoolId,
|
|
112
113
|
state: state.state,
|
|
113
114
|
}), [state, schoolId]);
|
|
@@ -11,11 +11,13 @@ import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
|
11
11
|
import { Building2, CheckCircle2, XCircle } from "lucide-react";
|
|
12
12
|
import { useCampusModule } from "./context";
|
|
13
13
|
import { useTranslations } from "next-intl";
|
|
14
|
-
import { formatValue } from "
|
|
15
|
-
import { formatPhoneDisplay } from "
|
|
14
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
15
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
16
16
|
export const CampusView = () => {
|
|
17
17
|
const { state } = useCampusModule();
|
|
18
18
|
const { address, city, code, country, enabled, name, phone, state: campusState, } = state;
|
|
19
19
|
const t = useTranslations("campus");
|
|
20
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(Building2, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: name }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsxs("p", { className: "text-muted-foreground mt-1", children: [t("viewFieldCode"), ": ", code] })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionCampusDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteCampusInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCampusName") }), _jsx("p", { className: "text-base", children: formatValue(name) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCampusCode") }), _jsx("p", { className: "text-base", children: formatValue(code) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldAddress") }), _jsx("p", { className: "text-base", children: formatValue(address) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCity") }), _jsx("p", { className: "text-base", children: formatValue(city) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldState") }), _jsx("p", { className: "text-base", children: formatValue(campusState) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCountry") }), _jsx("p", { className: "text-base", children: formatValue(country) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPhone") }), _jsx("p", { className: "text-base", children: formatPhoneDisplay(phone) || formatValue(phone) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
|
|
20
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(Building2, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: name }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsxs("p", { className: "text-muted-foreground mt-1", children: [t("viewFieldCode"), ": ", code] })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionCampusDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteCampusInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCampusName") }), _jsx("p", { className: "text-base", children: formatValue(name) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCampusCode") }), _jsx("p", { className: "text-base", children: formatValue(code) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldAddress") }), _jsx("p", { className: "text-base", children: formatValue(address) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCity") }), _jsx("p", { className: "text-base", children: formatValue(city) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldState") }), _jsx("p", { className: "text-base", children: formatValue(campusState) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCountry") }), _jsx("p", { className: "text-base", children: formatValue(country) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPhone") }), _jsx("p", { className: "text-base", children: formatPhoneDisplay(phone) || formatValue(phone) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
|
|
21
|
+
? t("viewFieldStatusActive")
|
|
22
|
+
: t("viewFieldStatusInactive") })] })] }) })] })] }));
|
|
21
23
|
};
|
|
@@ -11,10 +11,12 @@ import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
|
11
11
|
import { GraduationCap, CheckCircle2, XCircle } from "lucide-react";
|
|
12
12
|
import { useClassModule } from "./context";
|
|
13
13
|
import { useTranslations } from "next-intl";
|
|
14
|
-
import { formatValue } from "
|
|
14
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
15
15
|
export const ClassView = () => {
|
|
16
16
|
const { state } = useClassModule();
|
|
17
17
|
const { code, description, enabled, name } = state;
|
|
18
18
|
const t = useTranslations("class");
|
|
19
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(GraduationCap, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: name }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsxs("p", { className: "text-muted-foreground mt-1", children: [t("viewFieldCode"), ": ", code] })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(GraduationCap, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionClassDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteClassInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldClassName") }), _jsx("p", { className: "text-base", children: formatValue(name) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldClassCode") }), _jsx("p", { className: "text-base", children: formatValue(code) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldDescription") }), _jsx("p", { className: "text-base", children: formatValue(description) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
|
|
19
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(GraduationCap, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: name }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsxs("p", { className: "text-muted-foreground mt-1", children: [t("viewFieldCode"), ": ", code] })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(GraduationCap, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionClassDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteClassInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldClassName") }), _jsx("p", { className: "text-base", children: formatValue(name) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldClassCode") }), _jsx("p", { className: "text-base", children: formatValue(code) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldDescription") }), _jsx("p", { className: "text-base", children: formatValue(description) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
|
|
20
|
+
? t("viewFieldStatusActive")
|
|
21
|
+
: t("viewFieldStatusInactive") })] })] }) })] })] }));
|
|
20
22
|
};
|
|
@@ -14,7 +14,7 @@ import { getCachedSectionsSync } from "../section/cache";
|
|
|
14
14
|
import { getCachedSubjectsSync } from "../subject/cache";
|
|
15
15
|
import { getCachedTeachersSync } from "../teacher/cache";
|
|
16
16
|
import { useTranslations } from "next-intl";
|
|
17
|
-
import { formatValue } from "
|
|
17
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
18
18
|
export const CourseView = () => {
|
|
19
19
|
var _a, _b, _c, _d, _e;
|
|
20
20
|
const t = useTranslations("course");
|
|
@@ -36,5 +36,7 @@ export const CourseView = () => {
|
|
|
36
36
|
teacher.teacherCode ||
|
|
37
37
|
"—"
|
|
38
38
|
: "—";
|
|
39
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(BookMarked, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: formatValue(code) }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsx("p", { className: "text-muted-foreground mt-1", children: sectionName })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(BookMarked, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionCourseDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteCourseInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCourseCode") }), _jsx("p", { className: "text-base", children: formatValue(code) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("section") }), _jsx("p", { className: "text-base", children: sectionName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldSubject") }), _jsx("p", { className: "text-base", children: subjectName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldTeacher") }), _jsx("p", { className: "text-base", children: teacherName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
|
|
39
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(BookMarked, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: formatValue(code) }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsx("p", { className: "text-muted-foreground mt-1", children: sectionName })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(BookMarked, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionCourseDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteCourseInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCourseCode") }), _jsx("p", { className: "text-base", children: formatValue(code) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("section") }), _jsx("p", { className: "text-base", children: sectionName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldSubject") }), _jsx("p", { className: "text-base", children: subjectName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldTeacher") }), _jsx("p", { className: "text-base", children: teacherName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
|
|
40
|
+
? t("viewFieldStatusActive")
|
|
41
|
+
: t("viewFieldStatusInactive") })] })] }) })] })] }));
|
|
40
42
|
};
|
|
@@ -15,7 +15,7 @@ import { Badge } from "@appcorp/shadcn/components/ui/badge";
|
|
|
15
15
|
import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
16
16
|
import { CheckCircle2, XCircle } from "lucide-react";
|
|
17
17
|
import { DISCOUNT_TYPE } from "../../type";
|
|
18
|
-
import { formatValue } from "
|
|
18
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
19
19
|
export const DiscountCodeView = () => {
|
|
20
20
|
const { state } = useDiscountCodeModule();
|
|
21
21
|
const t = useTranslations("discountCode");
|
|
@@ -13,7 +13,7 @@ import { useExpenseModule } from "./context";
|
|
|
13
13
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
14
14
|
import { formatDate, DATE_FORMATS } from "@react-pakistan/util-functions";
|
|
15
15
|
import { useTranslations } from "next-intl";
|
|
16
|
-
import { formatValue } from "
|
|
16
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
17
17
|
export const ExpenseView = () => {
|
|
18
18
|
var _a, _b;
|
|
19
19
|
const { state } = useExpenseModule();
|
|
@@ -44,9 +44,11 @@ export const ExpenseView = () => {
|
|
|
44
44
|
return "secondary";
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "h-5 w-5
|
|
47
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionExpenseInformation") })] }), _jsx(CardDescription, { children: t("viewSectionReadOnlyExpenseInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldTitle") }), _jsx("p", { className: "text-base font-semibold", children: formatValue(title) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldDescription") }), _jsx("p", { className: "text-base", children: formatValue(description) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(DollarSign, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldAmount") })] }), _jsxs("p", { className: "text-base font-bold", children: [currency, " ", Number(amount !== null && amount !== void 0 ? amount : 0).toFixed(2)] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCategory") }), _jsx(Badge, { variant: "outline", children: formatValue(category) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsxs(Badge, { className: "gap-1", variant: getStatusVariant(), children: [getStatusIcon(), formatValue(status)] })] }), remarks && (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldRemarks") }), _jsx("p", { className: "text-base", children: remarks })] })), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldRecordState") }), _jsxs(Badge, { className: "gap-1", variant: enabled ? "default" : "destructive", children: [enabled ? (_jsx(CheckCircle2, { className: "h-3 w-3" })) : (_jsx(XCircle, { className: "h-3 w-3" })), enabled
|
|
48
|
+
? t("viewFieldStatusActive")
|
|
49
|
+
: t("viewFieldStatusInactive")] })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(DollarSign, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionPaymentDetails") })] }), _jsx(CardDescription, { children: t("viewPaymentDetailsDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldExpenseDate") })] }), _jsx("p", { className: "text-base", children: expenseDate
|
|
48
50
|
? formatDate(expenseDate, DATE_FORMATS.LOCALE_DATE)
|
|
49
|
-
: "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "h-4 w-4
|
|
51
|
+
: "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPaymentDate") })] }), _jsx("p", { className: "text-base", children: paymentDate
|
|
50
52
|
? formatDate(paymentDate, DATE_FORMATS.LOCALE_DATE)
|
|
51
|
-
: "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium
|
|
53
|
+
: "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPaymentMethod") }), _jsx("p", { className: "text-base", children: formatValue(paymentMethod) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldInvoiceNumber") }), _jsx("p", { className: "font-mono text-base", children: formatValue(invoiceNumber) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldReceiptNumber") }), _jsx("p", { className: "font-mono text-base", children: formatValue(receiptNumber) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldTransactionId") }), _jsx("p", { className: "font-mono text-base", children: formatValue(transactionId) })] })] }) })] }), (vendorName || vendorContact) && (_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionVendorInformation") })] }), _jsx(CardDescription, { children: t("viewSectionVendorDetails") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldVendorName") }), _jsx("p", { className: "text-base", children: formatValue(vendorName) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldVendorContact") }), _jsx("p", { className: "text-base", children: formatValue(vendorContact) })] })] }) })] }))] }));
|
|
52
54
|
};
|
|
@@ -6,7 +6,7 @@ import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
|
6
6
|
import { CheckCircle2, Home, MapPin, Users, XCircle } from "lucide-react";
|
|
7
7
|
import { useFamilyModule } from "./context";
|
|
8
8
|
import { useTranslations } from "next-intl";
|
|
9
|
-
import { formatValue } from "
|
|
9
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
10
10
|
export const FamilyView = () => {
|
|
11
11
|
const { state } = useFamilyModule();
|
|
12
12
|
const { address, city, country, enabled, familyCode, postalCode, stateProvince, } = state;
|
|
@@ -29,7 +29,8 @@ import { FAMILY_MEMBER_API_ROUTES, pageLimit } from "./constants";
|
|
|
29
29
|
import { getCachedFamilyMembers, invalidateFamilyMembersCache } from "./cache";
|
|
30
30
|
import { familyMemberFormValidation } from "./validate";
|
|
31
31
|
import { generateThemeToast, TOAST_VARIANT, } from "@appcorp/shadcn/lib/toast-utils";
|
|
32
|
-
import {
|
|
32
|
+
import { formatNumber } from "@react-pakistan/util-functions/general/format-number";
|
|
33
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
33
34
|
import { useTranslations } from "next-intl";
|
|
34
35
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
35
36
|
import { Eye, Filter, MoreHorizontal, Pencil, Plus } from "lucide-react";
|
|
@@ -128,11 +129,11 @@ export const useFamilyMemberModule = () => {
|
|
|
128
129
|
dateOfBirth: state.dateOfBirth,
|
|
129
130
|
gender: state.gender,
|
|
130
131
|
bloodGroup: state.bloodGroup,
|
|
131
|
-
phone:
|
|
132
|
+
phone: formatNumber(state.phone),
|
|
132
133
|
email: state.email,
|
|
133
134
|
relationship: state.relationship,
|
|
134
135
|
occupation: state.occupation,
|
|
135
|
-
emergencyPhone:
|
|
136
|
+
emergencyPhone: formatNumber(state.emergencyPhone),
|
|
136
137
|
idNumber: state.idNumber,
|
|
137
138
|
avatar: state.avatar,
|
|
138
139
|
isPrimary: state.isPrimary,
|
|
@@ -13,13 +13,14 @@ import { DATE_FORMATS, formatDate } from "@react-pakistan/util-functions";
|
|
|
13
13
|
import { Briefcase, Calendar, CheckCircle2, Heart, Mail, Phone, ShieldCheck, User, Users, XCircle, } from "lucide-react";
|
|
14
14
|
import { useFamilyMemberModule } from "./context";
|
|
15
15
|
import { useTranslations } from "next-intl";
|
|
16
|
-
import { formatValue } from "
|
|
17
|
-
import { formatPhoneDisplay } from "
|
|
16
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
17
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
18
18
|
export const FamilyMemberView = () => {
|
|
19
19
|
const { state } = useFamilyMemberModule();
|
|
20
20
|
const { avatar, bloodGroup, dateOfBirth, email, emergencyPhone, enabled, firstName, gender, idNumber, isPrimary, lastName, occupation, phone, relationship, role, } = state;
|
|
21
21
|
const t = useTranslations("familyMember");
|
|
22
|
-
const fullName = [firstName, lastName].filter(Boolean).join(" ") ||
|
|
22
|
+
const fullName = [firstName, lastName].filter(Boolean).join(" ") ||
|
|
23
|
+
t("viewFieldFamilyMember");
|
|
23
24
|
const initials = `${(firstName === null || firstName === void 0 ? void 0 : firstName[0]) || ""}${(lastName === null || lastName === void 0 ? void 0 : lastName[0]) || ""}`
|
|
24
25
|
.toUpperCase()
|
|
25
26
|
.slice(0, 2);
|
|
@@ -34,7 +35,9 @@ export const FamilyMemberView = () => {
|
|
|
34
35
|
return formatDate(new Date(value).toISOString(), DATE_FORMATS.LOCALE_DATE);
|
|
35
36
|
};
|
|
36
37
|
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsxs(Avatar, { className: "h-24 w-24", children: [_jsx(AvatarImage, { src: avatar || undefined, alt: fullName }), _jsx(AvatarFallback, { className: "text-2xl", children: initials || "FM" })] }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: fullName }), enabled ? (_jsxs(Badge, { variant: "default", className: "gap-1", children: [_jsx(CheckCircle2, { className: "h-3 w-3" }), t("badgeActive")] })) : (_jsxs(Badge, { variant: "secondary", className: "gap-1", children: [_jsx(XCircle, { className: "h-3 w-3" }), t("badgeInactive")] })), isPrimary && (_jsxs(Badge, { variant: "outline", className: "gap-1", children: [_jsx(ShieldCheck, { className: "h-3 w-3" }), t("viewFieldPrimaryContact")] }))] }), _jsx("p", { className: "text-muted-foreground mt-1 text-sm", children: t("viewFieldFamilyMemberProfile") }), _jsxs("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: [role ? (_jsx(Badge, { variant: "secondary", className: "capitalize", children: formatEnumValue(role) })) : null, relationship ? (_jsx(Badge, { variant: "outline", className: "capitalize", children: formatEnumValue(relationship) })) : null, gender ? (_jsx(Badge, { variant: "outline", className: "capitalize", children: formatEnumValue(gender) })) : null] })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(User, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionPersonalInformation") })] }), _jsx(CardDescription, { children: t("viewSectionBasicIdentityAndProfileDetails") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldFirstName") }), _jsx("p", { className: "text-base", children: formatValue(firstName) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldLastName") }), _jsx("p", { className: "text-base", children: formatValue(lastName) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldRole") }), role ? (_jsx(Badge, { variant: "secondary", className: "capitalize", children: formatEnumValue(role) })) : (_jsx("p", { className: "text-base", children: "\u2014" }))] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldDateOfBirth") })] }), _jsx("p", { className: "text-base", children: formatDateValue(dateOfBirth) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldGender") }), gender ? (_jsx(Badge, { variant: "outline", className: "capitalize", children: formatEnumValue(gender) })) : (_jsx("p", { className: "text-base", children: "\u2014" }))] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Heart, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldBloodGroup") })] }), _jsx("p", { className: "text-base", children: formatValue(bloodGroup) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldIdNumber") }), _jsx("p", { className: "text-base", children: formatValue(idNumber) })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Phone, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionContactInformation") })] }), _jsx(CardDescription, { children: t("viewSectionReachabilityAndEmergencyContactDetails") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Phone, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPhone") })] }), _jsx("p", { className: "text-base", children: formatPhoneDisplay(phone) || formatValue(phone) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Mail, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldEmail") })] }), _jsx("p", { className: "text-base", children: formatValue(email) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Phone, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldEmergencyPhone") })] }), _jsx("p", { className: "text-base", children: formatPhoneDisplay(emergencyPhone) ||
|
|
37
|
-
formatValue(emergencyPhone) })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Users, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewFieldFamilyRole") })] }), _jsx(CardDescription, { children: t("viewFieldRelationshipAndHouseholdResponsibilities") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldRelationship") }), relationship ? (_jsx(Badge, { variant: "secondary", className: "capitalize", children: formatEnumValue(relationship) })) : (_jsx("p", { className: "text-base", children: "\u2014" }))] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Briefcase, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldOccupation") })] }), _jsx("p", { className: "text-base", children: formatValue(occupation) })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(ShieldCheck, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewFieldStatus") })] }), _jsx(CardDescription, { children: t("viewFieldPrimaryContactAndAccountActivity") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(ShieldCheck, { className: "text-primary mt-0.5 h-5 w-5" }), _jsxs("div", { children: [_jsx("p", { className: "font-medium", children: isPrimary
|
|
38
|
+
formatValue(emergencyPhone) })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Users, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewFieldFamilyRole") })] }), _jsx(CardDescription, { children: t("viewFieldRelationshipAndHouseholdResponsibilities") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldRelationship") }), relationship ? (_jsx(Badge, { variant: "secondary", className: "capitalize", children: formatEnumValue(relationship) })) : (_jsx("p", { className: "text-base", children: "\u2014" }))] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Briefcase, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldOccupation") })] }), _jsx("p", { className: "text-base", children: formatValue(occupation) })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(ShieldCheck, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewFieldStatus") })] }), _jsx(CardDescription, { children: t("viewFieldPrimaryContactAndAccountActivity") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx(ShieldCheck, { className: "text-primary mt-0.5 h-5 w-5" }), _jsxs("div", { children: [_jsx("p", { className: "font-medium", children: isPrimary
|
|
39
|
+
? t("viewFieldPrimaryContact")
|
|
40
|
+
: t("viewFieldSecondaryContact") }), _jsx("p", { className: "text-muted-foreground text-sm", children: isPrimary
|
|
38
41
|
? t("viewFieldThisIsPrimaryFamilyContact")
|
|
39
42
|
: t("viewFieldThisIsAdditionalFamilyContact") })] })] }), _jsxs("div", { className: "flex items-start gap-3", children: [enabled ? (_jsx(CheckCircle2, { className: "mt-0.5 h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "mt-0.5 h-5 w-5 text-red-500" })), _jsxs("div", { children: [_jsx("p", { className: "font-medium", children: enabled ? t("badgeActive") : t("badgeInactive") }), _jsx("p", { className: "text-muted-foreground text-sm", children: enabled
|
|
40
43
|
? t("viewFieldThisAccountIsCurrentlyActive")
|
|
@@ -12,13 +12,15 @@ import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
|
12
12
|
import { CheckCircle2, DollarSign, FileText, XCircle } from "lucide-react";
|
|
13
13
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
14
14
|
import { useTranslations } from "next-intl";
|
|
15
|
-
import { formatValue } from "
|
|
15
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
16
16
|
export const FeeStructureView = () => {
|
|
17
17
|
var _a;
|
|
18
18
|
const { state } = useFeeStructureModule();
|
|
19
19
|
const { amount, description, enabled, feeType, frequency, name } = state;
|
|
20
20
|
const t = useTranslations("feeStructure");
|
|
21
21
|
const workspace = getCachedWorkspaceSync();
|
|
22
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(DollarSign, { className: "h-5 w-5
|
|
22
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(DollarSign, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionFeeStructureDetails") })] }), _jsx(CardDescription, { children: t("viewSectionFeeStructureRecordDetails") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldName") }), _jsx("p", { className: "text-base font-semibold", children: formatValue(name) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldFeeType") }), _jsx(Badge, { variant: "secondary", children: formatValue(feeType) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldAmount") }), _jsxs("p", { className: "text-base", children: [(_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.currency, " ", Number(amount !== null && amount !== void 0 ? amount : 0).toFixed(2)] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldFrequency") }), _jsx("p", { className: "text-base", children: formatValue(frequency) })] })] }) })] }), description ? (_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionAdditionalDetails") })] }), _jsx(CardDescription, { children: t("viewFieldOptionalNotes") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsx("p", { className: "text-base", children: description }) })] })) : null, _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewFieldStatus") })] }), _jsx(CardDescription, { children: t("viewFieldRecordState") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs(Badge, { variant: enabled ? "default" : "destructive", className: "gap-1", children: [enabled ? (_jsx(CheckCircle2, { className: "h-3 w-3" })) : (_jsx(XCircle, { className: "h-3 w-3" })), enabled
|
|
23
|
+
? t("viewFieldStatusActive")
|
|
24
|
+
: t("viewFieldStatusInactive")] }) })] })] }));
|
|
23
25
|
};
|
|
24
26
|
FeeStructureView.displayName = "FeeStructureView";
|
|
@@ -29,7 +29,8 @@ import { SCHOOL_API_ROUTES } from "./constants";
|
|
|
29
29
|
import { invalidateSchoolCache } from "./cache";
|
|
30
30
|
import { schoolFormValidation } from "./validate";
|
|
31
31
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
32
|
-
import {
|
|
32
|
+
import { formatNumber } from "@react-pakistan/util-functions/general/format-number";
|
|
33
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
33
34
|
// ============================================================================
|
|
34
35
|
// 1.1 DRAWER TYPES
|
|
35
36
|
// ============================================================================
|
|
@@ -101,7 +102,7 @@ export const useSchoolModule = () => {
|
|
|
101
102
|
id: state.id,
|
|
102
103
|
logo: state.logo,
|
|
103
104
|
name: state.name,
|
|
104
|
-
phone:
|
|
105
|
+
phone: formatNumber(state.phone),
|
|
105
106
|
postalCode: state.postalCode,
|
|
106
107
|
principalId: state.principalId,
|
|
107
108
|
state: state.state,
|
|
@@ -11,8 +11,8 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@app
|
|
|
11
11
|
import { Badge } from "@appcorp/shadcn/components/ui/badge";
|
|
12
12
|
import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
13
13
|
import { Building2, MapPin, Phone, Mail, Globe, Image, CheckCircle2, XCircle, User, DollarSign, } from "lucide-react";
|
|
14
|
-
import { formatValue } from "
|
|
15
|
-
import { formatPhoneDisplay } from "
|
|
14
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
15
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
16
16
|
export const SchoolView = () => {
|
|
17
17
|
const { state } = useSchoolModule();
|
|
18
18
|
const { name, code, currency, address, city, state: _state, country, postalCode, enabled, phone, email, website, logo, principalId, } = state;
|
|
@@ -11,7 +11,7 @@ import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
|
11
11
|
import { GraduationCap, CheckCircle2, XCircle, Users } from "lucide-react";
|
|
12
12
|
import { useSectionModule } from "./context";
|
|
13
13
|
import { useTranslations } from "next-intl";
|
|
14
|
-
import { formatValue } from "
|
|
14
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
15
15
|
import { getCachedClassesSync } from "../class/cache";
|
|
16
16
|
export const SectionView = () => {
|
|
17
17
|
const { state } = useSectionModule();
|
|
@@ -22,5 +22,7 @@ export const SectionView = () => {
|
|
|
22
22
|
const className = selectedClass
|
|
23
23
|
? `${selectedClass.name} (${selectedClass.code})`
|
|
24
24
|
: "—";
|
|
25
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(Users, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: name }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsxs("p", { className: "text-muted-foreground mt-1", children: [t("viewFieldClass"), ": ", className] })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(GraduationCap, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("sectionDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteSectionInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("sectionName") }), _jsx("p", { className: "text-base", children: formatValue(name) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldClass") }), _jsx("p", { className: "text-base", children: className })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCapacity") }), _jsxs("p", { className: "text-base", children: [formatValue(capacity), " ", capacity !== null ? t("viewFieldStudents") : ""] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
|
|
25
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(Users, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: name }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsxs("p", { className: "text-muted-foreground mt-1", children: [t("viewFieldClass"), ": ", className] })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(GraduationCap, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("sectionDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteSectionInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("sectionName") }), _jsx("p", { className: "text-base", children: formatValue(name) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldClass") }), _jsx("p", { className: "text-base", children: className })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCapacity") }), _jsxs("p", { className: "text-base", children: [formatValue(capacity), " ", capacity !== null ? t("viewFieldStudents") : ""] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
|
|
26
|
+
? t("viewFieldStatusActive")
|
|
27
|
+
: t("viewFieldStatusInactive") })] })] }) })] })] }));
|
|
26
28
|
};
|
|
@@ -27,7 +27,8 @@ import { createGenericModule } from "@react-pakistan/util-functions/factory/gene
|
|
|
27
27
|
import { DRAWER_TYPES } from "@react-pakistan/util-functions/factory/generic-component-factory";
|
|
28
28
|
import { generateThemeToast, TOAST_VARIANT, } from "@appcorp/shadcn/lib/toast-utils";
|
|
29
29
|
import { STUDENT_STATUS } from "../../type";
|
|
30
|
-
import {
|
|
30
|
+
import { formatNumber } from "@react-pakistan/util-functions/general/format-number";
|
|
31
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
31
32
|
import { STUDENT_PROFILE_API_ROUTES, pageLimit } from "./constants";
|
|
32
33
|
import { studentProfileFormValidation } from "./validate";
|
|
33
34
|
import { getCachedStudentProfiles, invalidateStudentProfilesCache, } from "./cache";
|
|
@@ -130,14 +131,14 @@ export const useStudentProfileModule = () => {
|
|
|
130
131
|
bloodGroup: state.bloodGroup,
|
|
131
132
|
dateOfBirth: state.dateOfBirth,
|
|
132
133
|
email: state.email,
|
|
133
|
-
emergencyPhone:
|
|
134
|
+
emergencyPhone: formatNumber(state.emergencyPhone),
|
|
134
135
|
enabled: state.enabled,
|
|
135
136
|
familyMemberId: state.familyMemberId,
|
|
136
137
|
firstName: state.firstName,
|
|
137
138
|
gender: state.gender,
|
|
138
139
|
id: state.id,
|
|
139
140
|
lastName: state.lastName,
|
|
140
|
-
phone:
|
|
141
|
+
phone: formatNumber(state.phone),
|
|
141
142
|
status: state.status,
|
|
142
143
|
studentCode: state.studentCode,
|
|
143
144
|
}), [
|
|
@@ -8,8 +8,8 @@ import { formatDate, DATE_FORMATS } from "@react-pakistan/util-functions";
|
|
|
8
8
|
import { User, Phone, MapPin, Calendar, GraduationCap, CheckCircle2, XCircle, } from "lucide-react";
|
|
9
9
|
import { useTranslations } from "next-intl";
|
|
10
10
|
import { useStudentProfileModule } from "./context";
|
|
11
|
-
import { formatValue } from "
|
|
12
|
-
import { formatPhoneDisplay } from "
|
|
11
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
12
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
13
13
|
export const StudentProfileView = () => {
|
|
14
14
|
const t = useTranslations("studentProfile");
|
|
15
15
|
const context = useStudentProfileModule();
|
|
@@ -11,10 +11,12 @@ import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
|
11
11
|
import { BookOpen, CheckCircle2, XCircle } from "lucide-react";
|
|
12
12
|
import { useSubjectModule } from "./context";
|
|
13
13
|
import { useTranslations } from "next-intl";
|
|
14
|
-
import { formatValue } from "
|
|
14
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
15
15
|
export const SubjectView = () => {
|
|
16
16
|
const { state } = useSubjectModule();
|
|
17
17
|
const { code, description, enabled, name } = state;
|
|
18
18
|
const t = useTranslations("subject");
|
|
19
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(BookOpen, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: name }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsx("p", { className: "text-muted-foreground mt-1", children: code })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(BookOpen, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionSubjectDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteSubjectInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldSubjectName") }), _jsx("p", { className: "text-base", children: formatValue(name) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldSubjectCode") }), _jsx("p", { className: "text-base", children: formatValue(code) })] }), description && (_jsxs("div", { className: "col-span-full space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldDescription") }), _jsx("p", { className: "text-base", children: description })] })), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
|
|
19
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(BookOpen, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: name }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsx("p", { className: "text-muted-foreground mt-1", children: code })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(BookOpen, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionSubjectDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteSubjectInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldSubjectName") }), _jsx("p", { className: "text-base", children: formatValue(name) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldSubjectCode") }), _jsx("p", { className: "text-base", children: formatValue(code) })] }), description && (_jsxs("div", { className: "col-span-full space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldDescription") }), _jsx("p", { className: "text-base", children: description })] })), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
|
|
20
|
+
? t("viewFieldStatusActive")
|
|
21
|
+
: t("viewFieldStatusInactive") })] })] }) })] })] }));
|
|
20
22
|
};
|
|
@@ -27,7 +27,8 @@ import { createGenericModule } from "@react-pakistan/util-functions/factory/gene
|
|
|
27
27
|
import { DRAWER_TYPES } from "@react-pakistan/util-functions/factory/generic-component-factory";
|
|
28
28
|
import { generateThemeToast, TOAST_VARIANT, } from "@appcorp/shadcn/lib/toast-utils";
|
|
29
29
|
import { GENDER } from "../../type";
|
|
30
|
-
import {
|
|
30
|
+
import { formatNumber } from "@react-pakistan/util-functions/general/format-number";
|
|
31
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
31
32
|
import { TEACHER_API_ROUTES, pageLimit } from "./constants";
|
|
32
33
|
import { teacherFormValidation } from "./validate";
|
|
33
34
|
import { getCachedTeachers, invalidateTeachersCache } from "./cache";
|
|
@@ -124,7 +125,7 @@ export const useTeacherModule = () => {
|
|
|
124
125
|
city: state.city,
|
|
125
126
|
country: state.country,
|
|
126
127
|
dateOfBirth: state.dateOfBirth,
|
|
127
|
-
emergencyPhone:
|
|
128
|
+
emergencyPhone: formatNumber(state.emergencyPhone),
|
|
128
129
|
enabled: state.enabled,
|
|
129
130
|
experience: state.experience,
|
|
130
131
|
firstName: state.firstName,
|
|
@@ -132,7 +133,7 @@ export const useTeacherModule = () => {
|
|
|
132
133
|
id: state.id,
|
|
133
134
|
joiningDate: state.joiningDate,
|
|
134
135
|
lastName: state.lastName,
|
|
135
|
-
phone:
|
|
136
|
+
phone: formatNumber(state.phone),
|
|
136
137
|
postalCode: state.postalCode,
|
|
137
138
|
qualification: state.qualification,
|
|
138
139
|
schoolId,
|
|
@@ -6,8 +6,8 @@ import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
|
6
6
|
import { Avatar, AvatarFallback, AvatarImage, } from "@appcorp/shadcn/components/ui/avatar";
|
|
7
7
|
import { User, Phone, MapPin, Calendar, GraduationCap, CheckCircle2, XCircle, Briefcase, } from "lucide-react";
|
|
8
8
|
import { useTranslations } from "next-intl";
|
|
9
|
-
import { formatValue } from "
|
|
10
|
-
import { formatPhoneDisplay } from "
|
|
9
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
10
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
11
11
|
import { formatDate, DATE_FORMATS } from "@react-pakistan/util-functions";
|
|
12
12
|
import { useTeacherModule } from "./context";
|
|
13
13
|
export const TeacherView = () => {
|
|
@@ -34,7 +34,8 @@ import { invalidateWorkspaceUsersCache } from "../workspace-user/cache";
|
|
|
34
34
|
import { blobToWebP } from "webp-converter-browser";
|
|
35
35
|
import { supabasePublicStorageUrl } from "../../constants";
|
|
36
36
|
import { toastNetworkError } from "../../utils/toast-network-error";
|
|
37
|
-
import {
|
|
37
|
+
import { formatNumber } from "@react-pakistan/util-functions/general/format-number";
|
|
38
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
38
39
|
// ============================================================================
|
|
39
40
|
// 1.1 DRAWER TYPES
|
|
40
41
|
// ============================================================================
|
|
@@ -111,7 +112,7 @@ export const useUserModule = () => {
|
|
|
111
112
|
id: state.id,
|
|
112
113
|
name: (state.name || "").trim(),
|
|
113
114
|
password: state.password,
|
|
114
|
-
phone:
|
|
115
|
+
phone: formatNumber(state.phone),
|
|
115
116
|
userRole: state.userRole,
|
|
116
117
|
workspaceId: workspace === null || workspace === void 0 ? void 0 : workspace.id,
|
|
117
118
|
}), [state, workspace === null || workspace === void 0 ? void 0 : workspace.id]);
|
|
@@ -6,8 +6,8 @@ import { Badge } from "@appcorp/shadcn/components/ui/badge";
|
|
|
6
6
|
import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
7
7
|
import { Avatar, AvatarFallback, AvatarImage, } from "@appcorp/shadcn/components/ui/avatar";
|
|
8
8
|
import { User, Phone, Mail, CheckCircle2, XCircle } from "lucide-react";
|
|
9
|
-
import { formatValue } from "
|
|
10
|
-
import { formatPhoneDisplay } from "
|
|
9
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
10
|
+
import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
|
|
11
11
|
const getInitials = (fullName) => {
|
|
12
12
|
if (!fullName)
|
|
13
13
|
return "U";
|
|
@@ -13,7 +13,7 @@ import { Badge } from "@appcorp/shadcn/components/ui/badge";
|
|
|
13
13
|
import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
14
14
|
import { Building2, Globe, FileText, Image as LucideImage, CheckCircle2, XCircle, Calendar, CreditCard, Users, BookOpen, GraduationCap, Home, HardDrive, Clock, Shield, } from "lucide-react";
|
|
15
15
|
import { DATE_FORMATS, formatDate } from "@react-pakistan/util-functions";
|
|
16
|
-
import { formatValue } from "
|
|
16
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
17
17
|
export const WorkspaceView = () => {
|
|
18
18
|
const { state } = useWorkspaceModule();
|
|
19
19
|
const t = useTranslations("workspace");
|
|
@@ -11,7 +11,7 @@ import { Badge } from "@appcorp/shadcn/components/ui/badge";
|
|
|
11
11
|
import { Separator } from "@appcorp/shadcn/components/ui/separator";
|
|
12
12
|
import { Users, Building2, Shield, CheckCircle2, XCircle } from "lucide-react";
|
|
13
13
|
import { useTranslations } from "next-intl";
|
|
14
|
-
import { formatValue } from "
|
|
14
|
+
import { formatValue } from "@react-pakistan/util-functions/general/format-value";
|
|
15
15
|
export const WorkspaceUserView = () => {
|
|
16
16
|
const { state } = useWorkspaceUserModule();
|
|
17
17
|
const { enabled, role, workspace, workspaceId } = state;
|