@appcorp/fusion-storybook 0.2.65 → 0.2.67

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.
@@ -1,8 +1,2 @@
1
1
  import { FC } from "react";
2
- interface AttendanceFilterProps {
3
- labelAll: string;
4
- labelEnabled: string;
5
- labelDisabled: string;
6
- }
7
- export declare const AttendanceFilter: FC<AttendanceFilterProps>;
8
- export {};
2
+ export declare const AttendanceFilter: FC;
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useAttendanceModule } from "./context";
4
4
  import { EnhancedRadio } from "@appcorp/shadcn/components/enhanced-radio";
5
5
  import { useTranslations } from "next-intl";
6
- export const AttendanceFilter = ({ labelAll, labelEnabled, labelDisabled, }) => {
6
+ export const AttendanceFilter = () => {
7
7
  const t = useTranslations("attendance");
8
8
  const { state, handleChange } = useAttendanceModule();
9
9
  const { filterEnabled } = state;
@@ -13,9 +13,9 @@ export const AttendanceFilter = ({ labelAll, labelEnabled, labelDisabled, }) =>
13
13
  ? "true"
14
14
  : "false";
15
15
  return (_jsx("div", { className: "space-y-4", children: _jsx("div", { className: "grid grid-cols-1 gap-4", children: _jsx(EnhancedRadio, { label: t("filterOptionEnabled"), name: "filterEnabled", value: filterEnabledValue, options: [
16
- { label: labelAll, value: "undefined" },
17
- { label: labelEnabled, value: "true" },
18
- { label: labelDisabled, value: "false" },
16
+ { label: t("filterOptionAll"), value: "undefined" },
17
+ { label: t("filterOptionEnabled"), value: "true" },
18
+ { label: t("filterOptionDisabled"), value: "false" },
19
19
  ], onValueChange: (next) => {
20
20
  const parsed = next === "true" ? true : next === "false" ? false : undefined;
21
21
  handleChange("filterEnabled", parsed);
@@ -1,19 +1,8 @@
1
1
  import { FC } from "react";
2
2
  interface AttendanceMoreActionsProps {
3
3
  labelAttendanceStatus: string;
4
- labelCourse: string;
5
- labelCourseInfo: string;
6
- labelCoursePlaceholder: string;
7
- labelNoCourseFound: string;
8
- labelRemarks: string;
9
4
  labelRemarksInfo: string;
10
5
  labelRemarksPlaceholder: string;
11
- labelSearchCourses: string;
12
- labelStatusAbsent: string;
13
- labelStatusExcused: string;
14
- labelStatusHalfDay: string;
15
- labelStatusLate: string;
16
- labelStatusPresent: string;
17
6
  }
18
7
  export declare const AttendanceMoreActions: FC<AttendanceMoreActionsProps>;
19
8
  export {};
@@ -4,8 +4,9 @@ import { useEnhancedCombobox } from "@appcorp/shadcn/hooks/use-enhanced-combobox
4
4
  import { EnhancedRadio } from "@appcorp/shadcn/components/enhanced-radio";
5
5
  import { EnhancedTextarea } from "@appcorp/shadcn/components/enhanced-textarea";
6
6
  import { useState } from "react";
7
+ import { useTranslations } from "next-intl";
7
8
  import { COURSE_API_ROUTES } from "../../constants";
8
- export const AttendanceMoreActions = ({ labelAttendanceStatus, labelCourse, labelCourseInfo, labelCoursePlaceholder, labelNoCourseFound, labelRemarks, labelRemarksInfo, labelRemarksPlaceholder, labelSearchCourses, labelStatusAbsent, labelStatusExcused, labelStatusHalfDay, labelStatusLate, labelStatusPresent, }) => {
9
+ export const AttendanceMoreActions = ({ labelAttendanceStatus, labelRemarksInfo, labelRemarksPlaceholder, }) => {
9
10
  // const enrollment = getCachedEnrollmentsSync().items;
10
11
  // const studentProfiles = getCachedStudentProfilesSync().items;
11
12
  // const courses = getCachedCoursesSync().items;
@@ -13,20 +14,21 @@ export const AttendanceMoreActions = ({ labelAttendanceStatus, labelCourse, labe
13
14
  const [remarks, setRemarks] = useState({});
14
15
  const [attendance, setAttendance] = useState({});
15
16
  const [errors] = useState({});
17
+ const t = useTranslations("attendance");
16
18
  const { enhancedComboboxElement: courseIdCombo } = useEnhancedCombobox({
17
- emptyText: labelNoCourseFound,
19
+ emptyText: t("formCourseEmptyText"),
18
20
  id: "courseId",
19
- info: labelCourseInfo,
20
- label: labelCourse,
21
+ info: t("formCourseInfo"),
22
+ label: t("formCourseLabel"),
21
23
  onValueChange: (value) => setCourseId(value),
22
24
  options: [{ id: "", code: "" }].map((c) => ({
23
25
  value: c.id,
24
26
  label: c.code.trim(),
25
27
  })),
26
- placeholder: labelCoursePlaceholder,
28
+ placeholder: t("formCoursePlaceholder"),
27
29
  required: true,
28
30
  searchEndpoint: COURSE_API_ROUTES.UNIT,
29
- searchPlaceholder: labelSearchCourses,
31
+ searchPlaceholder: t("formCourseSearchPlaceholder"),
30
32
  formatSearchResult: (item) => {
31
33
  var _a, _b;
32
34
  return ({
@@ -49,13 +51,13 @@ export const AttendanceMoreActions = ({ labelAttendanceStatus, labelCourse, labe
49
51
  [].map((s) => {
50
52
  // const student = studentProfiles.find((sp) => sp.id === s);
51
53
  return (_jsxs("div", { children: [_jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsxs("div", { className: "flex flex-col items-center justify-center", children: [_jsx("p", { children: " " }), _jsx("img", { src: "student?.familyMember?.avatar", alt: "student?.familyMember?.firstName", width: 100, height: 100, className: "rounded-full" })] }), _jsx("div", { children: _jsx(EnhancedRadio, { label: labelAttendanceStatus, name: "attendanceStatus", value: attendance[s] || "PRESENT", options: [
52
- { label: labelStatusPresent, value: "PRESENT" },
53
- { label: labelStatusAbsent, value: "ABSENT" },
54
- { label: labelStatusLate, value: "LATE" },
55
- { label: labelStatusExcused, value: "EXCUSED" },
56
- { label: labelStatusHalfDay, value: "HALF_DAY" },
54
+ { label: t("formOptionPresent"), value: "PRESENT" },
55
+ { label: t("formOptionAbsent"), value: "ABSENT" },
56
+ { label: t("formOptionLate"), value: "LATE" },
57
+ { label: t("formOptionExcused"), value: "EXCUSED" },
58
+ { label: t("formOptionHalfDay"), value: "HALF_DAY" },
57
59
  ], onValueChange: (next) => {
58
60
  setAttendance((prev) => (Object.assign(Object.assign({}, prev), { [s]: next })));
59
- } }) })] }), _jsx(EnhancedTextarea, { error: errors.remarks, id: "remarks", info: labelRemarksInfo, label: labelRemarks, onChange: (e) => setRemarks((prev) => (Object.assign(Object.assign({}, prev), { [s]: e.target.value }))), placeholder: labelRemarksPlaceholder, rows: 0, value: remarks[s] })] }, s));
61
+ } }) })] }), _jsx(EnhancedTextarea, { error: errors.remarks, id: "remarks", info: labelRemarksInfo, label: t("formRemarksLabel"), onChange: (e) => setRemarks((prev) => (Object.assign(Object.assign({}, prev), { [s]: e.target.value }))), placeholder: labelRemarksPlaceholder, rows: 0, value: remarks[s] })] }, s));
60
62
  })] }));
61
63
  };
@@ -24,26 +24,14 @@ interface Props {
24
24
  drawerViewDescription: string;
25
25
  drawerViewTitle: string;
26
26
  labelActions: string;
27
- labelAll: string;
28
27
  labelAttendanceStatus: string;
29
- labelCourse: string;
30
- labelCourseInfo: string;
31
- labelCoursePlaceholder: string;
32
28
  labelDate: string;
33
- labelDisabled: string;
34
29
  labelEnabled: string;
35
30
  labelId: string;
36
- labelNoCourseFound: string;
37
31
  labelRemarks: string;
38
32
  labelRemarksInfo: string;
39
33
  labelRemarksPlaceholder: string;
40
- labelSearchCourses: string;
41
34
  labelStatus: string;
42
- labelStatusAbsent: string;
43
- labelStatusExcused: string;
44
- labelStatusHalfDay: string;
45
- labelStatusLate: string;
46
- labelStatusPresent: string;
47
35
  labelStudent: string;
48
36
  saveLabel: string;
49
37
  searchPlaceholder: string;
@@ -56,9 +56,9 @@ const tableBodyCols = [
56
56
  // COMPONENT INSTANCES (memoized — no runtime deps)
57
57
  // ============================================================================
58
58
  const createComponentInstances = (props) => ({
59
- filter: (_jsx(AttendanceFilter, { labelAll: props.labelAll, labelEnabled: props.labelEnabled, labelDisabled: props.labelDisabled })),
59
+ filter: _jsx(AttendanceFilter, {}),
60
60
  form: _jsx(AttendanceForm, {}),
61
- moreActions: (_jsx(AttendanceMoreActions, { labelAttendanceStatus: props.labelAttendanceStatus, labelCourse: props.labelCourse, labelCourseInfo: props.labelCourseInfo, labelCoursePlaceholder: props.labelCoursePlaceholder, labelNoCourseFound: props.labelNoCourseFound, labelRemarks: props.labelRemarks, labelRemarksInfo: props.labelRemarksInfo, labelRemarksPlaceholder: props.labelRemarksPlaceholder, labelSearchCourses: props.labelSearchCourses, labelStatusAbsent: props.labelStatusAbsent, labelStatusExcused: props.labelStatusExcused, labelStatusHalfDay: props.labelStatusHalfDay, labelStatusLate: props.labelStatusLate, labelStatusPresent: props.labelStatusPresent })),
61
+ moreActions: (_jsx(AttendanceMoreActions, { labelAttendanceStatus: props.labelAttendanceStatus, labelRemarksInfo: props.labelRemarksInfo, labelRemarksPlaceholder: props.labelRemarksPlaceholder })),
62
62
  view: _jsx(AttendanceView, {}),
63
63
  });
64
64
  const createAttendanceConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions, labelDate, labelEnabled, labelId, labelRemarks, labelStatus, labelStudent, saveLabel, searchPlaceholder, tableDescription, tableTitle, components, }) => {
@@ -102,41 +102,13 @@ const GenericAttendancePage = createGenericModulePage();
102
102
  const AttendancePageInner = (props) => {
103
103
  const context = useAttendanceModule();
104
104
  const components = useMemo(() => createComponentInstances({
105
- labelAll: props.labelAll,
106
- labelEnabled: props.labelEnabled,
107
- labelDisabled: props.labelDisabled,
108
105
  labelAttendanceStatus: props.labelAttendanceStatus,
109
- labelCourse: props.labelCourse,
110
- labelCourseInfo: props.labelCourseInfo,
111
- labelCoursePlaceholder: props.labelCoursePlaceholder,
112
- labelNoCourseFound: props.labelNoCourseFound,
113
- labelRemarks: props.labelRemarks,
114
106
  labelRemarksInfo: props.labelRemarksInfo,
115
107
  labelRemarksPlaceholder: props.labelRemarksPlaceholder,
116
- labelSearchCourses: props.labelSearchCourses,
117
- labelStatusAbsent: props.labelStatusAbsent,
118
- labelStatusExcused: props.labelStatusExcused,
119
- labelStatusHalfDay: props.labelStatusHalfDay,
120
- labelStatusLate: props.labelStatusLate,
121
- labelStatusPresent: props.labelStatusPresent,
122
108
  }), [
123
- props.labelAll,
124
- props.labelEnabled,
125
- props.labelDisabled,
126
109
  props.labelAttendanceStatus,
127
- props.labelCourse,
128
- props.labelCourseInfo,
129
- props.labelCoursePlaceholder,
130
- props.labelNoCourseFound,
131
- props.labelRemarks,
132
110
  props.labelRemarksInfo,
133
111
  props.labelRemarksPlaceholder,
134
- props.labelSearchCourses,
135
- props.labelStatusAbsent,
136
- props.labelStatusExcused,
137
- props.labelStatusHalfDay,
138
- props.labelStatusLate,
139
- props.labelStatusPresent,
140
112
  ]);
141
113
  const attendanceConfig = useMemo(() => createAttendanceConfig({
142
114
  dispatch: context.dispatch,
@@ -24,6 +24,6 @@ export const AttendanceView = () => {
24
24
  studentProfile.studentCode
25
25
  : studentProfileId || "—";
26
26
  const formattedDate = date ? formatDate(date, DATE_FORMATS.LOCALE_DATE) : "—";
27
- 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(ClipboardList, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionAttendanceDetails") })] }), _jsx(CardDescription, { children: t("viewSectionAttendanceRecordDetails") })] }), _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(User, { className: "h-4 w-4 text-muted-foreground" }), _jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("viewFieldStudent") })] }), _jsx("p", { className: "text-base", children: studentName })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CalendarDays, { className: "h-4 w-4 text-muted-foreground" }), _jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("viewFieldDate") })] }), _jsx("p", { className: "text-base", children: formattedDate })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("viewFieldStatus") }), _jsx(Badge, { variant: "secondary", children: status || "—" })] })] }) })] }), _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 text-primary" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionAdditionalDetails") })] }), _jsx(CardDescription, { children: t("viewFieldOptionalNotes") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("viewFieldRemarks") }), _jsx("p", { className: "text-base", children: remarks || "—" })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { className: "text-lg", children: t("viewFieldStatusInfo") })] }), _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 ? t("viewFieldStatusActive") : t("viewFieldStatusInactive")] }) })] })] }));
27
+ 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(ClipboardList, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionAttendanceDetails") })] }), _jsx(CardDescription, { children: t("viewSectionAttendanceRecordDetails") })] }), _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(User, { className: "h-4 w-4 text-muted-foreground" }), _jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("viewFieldStudent") })] }), _jsx("p", { className: "text-base", children: studentName })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CalendarDays, { className: "h-4 w-4 text-muted-foreground" }), _jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("viewFieldDate") })] }), _jsx("p", { className: "text-base", children: formattedDate })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("viewFieldStatus") }), _jsx(Badge, { variant: "secondary", children: status || "—" })] })] }) })] }), _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 text-primary" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionAdditionalDetails") })] }), _jsx(CardDescription, { children: t("viewFieldOptionalNotes") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("viewFieldRemarks") }), _jsx("p", { className: "text-base", children: remarks || "—" })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { className: "text-lg", children: t("viewFieldStatusInfo") })] }), _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 ? t("badgeActive") : t("badgeInactive")] }) })] })] }));
28
28
  };
29
29
  AttendanceView.displayName = "AttendanceView";
@@ -66,8 +66,8 @@ export const CourseForm = () => {
66
66
  const { enhancedComboboxElement: sectionIdCombo } = useEnhancedCombobox({
67
67
  emptyText: t("formNoSectionEmpty"),
68
68
  id: "sectionId",
69
- info: t("sectionInfo"),
70
- label: t("section"),
69
+ info: t("formSectionInfo"),
70
+ label: t("formSectionLabel"),
71
71
  onValueChange: (value) => {
72
72
  var _a;
73
73
  handleChange("sectionId", value);
@@ -82,7 +82,7 @@ export const CourseForm = () => {
82
82
  : section.name,
83
83
  });
84
84
  }),
85
- placeholder: t("sectionPlaceholder"),
85
+ placeholder: t("formSectionPlaceholder"),
86
86
  required: true,
87
87
  searchEndpoint: SECTION_API_ROUTES.UNIT,
88
88
  searchPlaceholder: t("formSearchSectionsPlaceholder"),
@@ -40,7 +40,7 @@ export const CourseView = () => {
40
40
  teacher.teacherCode ||
41
41
  "—"
42
42
  : "—";
43
- 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" }))] }), _jsxs("p", { className: "text-muted-foreground mt-1", children: [className, " \u2014 ", 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("labelClass") }), _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("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
43
+ 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" }))] }), _jsxs("p", { className: "text-muted-foreground mt-1", children: [className, " \u2014 ", 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("labelClass") }), _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("formSectionLabel") }), _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
44
44
  ? t("viewFieldStatusActive")
45
45
  : t("viewFieldStatusInactive") })] })] }) })] })] }));
46
46
  };
@@ -100,14 +100,14 @@ export const EnrollmentForm = () => {
100
100
  const { enhancedComboboxElement: sectionIdCombo } = useEnhancedCombobox({
101
101
  emptyText: t("formNoSectionEmpty"),
102
102
  id: "sectionId",
103
- info: t("sectionInfo"),
104
- label: t("section"),
103
+ info: t("formSectionInfo"),
104
+ label: t("formSectionLabel"),
105
105
  onValueChange: (value) => handleChange("sectionId", value),
106
106
  options: ((sectionData === null || sectionData === void 0 ? void 0 : sectionData.items) || []).map((s) => ({
107
107
  value: s.id,
108
108
  label: s.name,
109
109
  })),
110
- placeholder: t("sectionPlaceholder"),
110
+ placeholder: t("formSectionPlaceholder"),
111
111
  required: true,
112
112
  searchEndpoint: SECTION_API_ROUTES.UNIT,
113
113
  searchPlaceholder: t("formSearchSectionsPlaceholder"),
@@ -37,7 +37,7 @@ export const EnrollmentView = memo(() => {
37
37
  ? `${section.class.code}-${section.name}`
38
38
  : section.name
39
39
  : (sectionId !== null && sectionId !== void 0 ? sectionId : "—");
40
- 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(BookOpen, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionEnrollmentDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteEnrollmentInformation") })] }), _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-sm font-medium text-muted-foreground", children: t("viewFieldStudent") }), _jsx("p", { className: "text-base", children: studentName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("labelClass") }), _jsx("p", { className: "text-base", children: className })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("section") }), _jsx("p", { className: "text-base", children: sectionName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("viewFieldEnrollmentDate") }), _jsx("p", { className: "text-base", children: enrollmentDate
40
+ 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(BookOpen, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionEnrollmentDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteEnrollmentInformation") })] }), _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-sm font-medium text-muted-foreground", children: t("viewFieldStudent") }), _jsx("p", { className: "text-base", children: studentName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("labelClass") }), _jsx("p", { className: "text-base", children: className })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("formSectionLabel") }), _jsx("p", { className: "text-base", children: sectionName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("viewFieldEnrollmentDate") }), _jsx("p", { className: "text-base", children: enrollmentDate
41
41
  ? formatDate(enrollmentDate, DATE_FORMATS.LOCALE_DATE)
42
42
  : "—" })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(BookOpen, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { className: "text-lg", children: t("viewFieldStatus") })] }), _jsx(CardDescription, { children: t("viewFieldEnrollmentAvailability") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsx("div", { className: "grid grid-cols-1 gap-6", children: _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-muted-foreground", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "destructive", className: "gap-1", children: enabled ? (_jsxs(_Fragment, { children: [_jsx(CheckCircle2, { className: "h-3 w-3" }), " ", t("viewFieldStatusActive")] })) : (_jsxs(_Fragment, { children: [_jsx(XCircle, { className: "h-3 w-3" }), " ", t("viewFieldStatusInactive")] })) })] }) }) })] })] }));
43
43
  });
@@ -30,7 +30,7 @@ export const FeeStructureForm = () => {
30
30
  TRANSPORT: t("formOptionTransport"),
31
31
  SPORTS: t("formOptionSports"),
32
32
  MISCELLANEOUS: t("formOptionMiscellaneous"),
33
- LATE: t("formOptionLate"),
33
+ LATE: t("formOptionLateFee"),
34
34
  };
35
35
  const frequencyLabelMap = {
36
36
  Monthly: t("formOptionMonthly"),
@@ -9,5 +9,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { useTranslations } from "next-intl";
10
10
  export const SchoolFilter = () => {
11
11
  const t = useTranslations("school");
12
- return (_jsx("div", { className: "p-6 text-center text-muted-foreground", children: _jsx("p", { children: t("filter") }) }));
12
+ return (_jsx("div", { className: "p-6 text-center text-muted-foreground", children: _jsx("p", { children: t("filterFallbackText") }) }));
13
13
  };
@@ -9,5 +9,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { useTranslations } from "next-intl";
10
10
  export const SchoolMoreActions = () => {
11
11
  const t = useTranslations("school");
12
- return (_jsx("div", { className: "p-6 text-center text-muted-foreground", children: _jsx("p", { children: t("moreActions") }) }));
12
+ return (_jsx("div", { className: "p-6 text-center text-muted-foreground", children: _jsx("p", { children: t("moreActionsFallbackText") }) }));
13
13
  };
@@ -17,9 +17,9 @@ 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;
19
19
  const t = useTranslations("school");
20
- return (_jsxs("div", { className: "space-y-6", children: [_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("viewSectionBasicInfo") })] }), _jsx(CardDescription, { children: t("viewBasicInfoDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-2 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsName") })] }), _jsx("p", { className: "text-base", children: formatValue(name) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsCode") })] }), _jsx("p", { className: "font-mono text-sm", children: formatValue(code) })] }), _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("viewLabelsCurrency") })] }), _jsx("p", { className: "text-base", children: formatValue(currency) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(MapPin, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsAddress") })] }), _jsx("p", { className: "text-base", children: formatValue(address) === "—"
20
+ return (_jsxs("div", { className: "space-y-6", children: [_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("viewSectionBasicInfo") })] }), _jsx(CardDescription, { children: t("viewBasicInfoDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-2 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldName") })] }), _jsx("p", { className: "text-base", children: formatValue(name) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCode") })] }), _jsx("p", { className: "font-mono text-sm", children: formatValue(code) })] }), _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("viewFieldCurrency") })] }), _jsx("p", { className: "text-base", children: formatValue(currency) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(MapPin, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldAddress") })] }), _jsx("p", { className: "text-base", children: formatValue(address) === "—"
21
21
  ? t("viewTextAddressNotProvided")
22
- : address })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsCity") }), _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("viewLabelsState") }), _jsx("p", { className: "text-base", children: formatValue(_state) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsCountry") }), _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("viewLabelsPostalCode") }), _jsx("p", { className: "text-base", children: formatValue(postalCode) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsStatus") }), _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 ? t("viewStatusEnabled") : t("viewStatusDisabled")] })] })] }) })] }), _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("viewSectionContactInfo") })] }), _jsx(CardDescription, { children: t("viewContactInfoDescription") })] }), _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("viewLabelsPhone") })] }), _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("viewLabelsEmail") })] }), _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(Globe, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsWebsite") })] }), _jsx("p", { className: "text-base", children: formatValue(website) === "—" ? (t("viewTextWebsiteNotProvided")) : (_jsx("a", { href: website, target: "_blank", rel: "noopener noreferrer", className: "text-primary hover:underline", children: website })) })] }), logo && (_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Image, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsLogo") })] }), _jsx("div", { className: "mt-2", children: _jsx("img", { src: logo, alt: t("viewLabelsLogoAlt"), className: "h-16 w-16 rounded border object-contain", onError: (e) => {
22
+ : 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(_state) })] }), _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("viewFieldPostalCode") }), _jsx("p", { className: "text-base", children: formatValue(postalCode) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _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 ? t("viewStatusEnabled") : t("viewStatusDisabled")] })] })] }) })] }), _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("viewSectionContactInfo") })] }), _jsx(CardDescription, { children: t("viewContactInfoDescription") })] }), _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(Globe, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldWebsite") })] }), _jsx("p", { className: "text-base", children: formatValue(website) === "—" ? (t("viewTextWebsiteNotProvided")) : (_jsx("a", { href: website, target: "_blank", rel: "noopener noreferrer", className: "text-primary hover:underline", children: website })) })] }), logo && (_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Image, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldLogo") })] }), _jsx("div", { className: "mt-2", children: _jsx("img", { src: logo, alt: t("viewFieldLogoAlt"), className: "h-16 w-16 rounded border object-contain", onError: (e) => {
23
23
  e.currentTarget.style.display = "none";
24
- } }) })] }))] }) })] }), _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("viewSectionAdministration") })] }), _jsx(CardDescription, { children: t("viewAdministrationDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsx("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(User, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsPrincipalId") })] }), _jsx("p", { className: "font-mono text-sm", children: formatValue(principalId) })] }) }) })] })] }));
24
+ } }) })] }))] }) })] }), _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("viewSectionAdministration") })] }), _jsx(CardDescription, { children: t("viewAdministrationDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsx("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(User, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPrincipalId") })] }), _jsx("p", { className: "font-mono text-sm", children: formatValue(principalId) })] }) }) })] })] }));
25
25
  };
@@ -14,7 +14,7 @@ export const SectionForm = () => {
14
14
  const { state, handleChange } = useSectionModule();
15
15
  const { capacity, enabled, errors, name } = state;
16
16
  const t = useTranslations("section");
17
- return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: errors.name, id: "name", info: t("sectionNameInfo"), label: t("sectionName"), onChange: (e) => handleChange("name", e.target.value), placeholder: t("sectionNamePlaceholder"), required: true, value: name }), _jsx(EnhancedInput, { error: errors.capacity, id: "capacity", info: t("formCapacityInfo"), label: t("formCapacityLabel"), onChange: (e) => {
17
+ return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: errors.name, id: "name", info: t("formSectionNameInfo"), label: t("viewFieldSectionName"), onChange: (e) => handleChange("name", e.target.value), placeholder: t("formSectionNamePlaceholder"), required: true, value: name }), _jsx(EnhancedInput, { error: errors.capacity, id: "capacity", info: t("formCapacityInfo"), label: t("formCapacityLabel"), onChange: (e) => {
18
18
  const value = e.target.value;
19
19
  handleChange("capacity", value ? Number(value) : 0);
20
20
  }, placeholder: t("formCapacityPlaceholder"), type: "number", value: (capacity === null || capacity === void 0 ? void 0 : capacity.toString()) || "" }), _jsx(EnhancedCheckbox, { label: t("formActiveSectionLabel"), defaultChecked: enabled, onCheckedChange: (checked) => handleChange("enabled", checked), info: t("actionToggleActivateOrDeactivateSection") })] }));
@@ -16,7 +16,7 @@ export const SectionView = () => {
16
16
  const { state } = useSectionModule();
17
17
  const { capacity, enabled, name } = state;
18
18
  const t = useTranslations("section");
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(Users, { className: "text-primary h-12 w-12" }) }), _jsx("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(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("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
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(Users, { className: "text-primary h-12 w-12" }) }), _jsx("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(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("viewSectionDetails") })] }), _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("viewFieldSectionName") }), _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("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
20
20
  ? t("viewFieldStatusActive")
21
21
  : t("viewFieldStatusInactive") })] })] }) })] })] }));
22
22
  };
@@ -52,7 +52,7 @@ export const UserForm = () => {
52
52
  },
53
53
  value: userRole !== null && userRole !== void 0 ? userRole : "",
54
54
  });
55
- return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedInput, { error: errors.name, id: "name", info: t("formNameInfo"), label: t("formNameLabel"), onChange: (e) => handleChange("name", e.target.value), placeholder: t("formNamePlaceholder"), required: true, value: name || "" }), _jsx(EnhancedInput, { error: errors.email, id: "email", info: t("formEmailInfo"), label: t("formEmailLabel"), onChange: (e) => handleChange("email", e.target.value), placeholder: t("formEmailPlaceholder"), required: true, type: "email", value: email }), _jsxs("div", { className: "relative", children: [_jsx(EnhancedInput, { error: errors.password, id: "password", info: t("formPasswordInfo"), label: t("formPasswordLabel"), onChange: (e) => handleChange("password", e.target.value), placeholder: t("formPasswordPlaceholder"), type: passwordVisible ? "text" : "password", value: password || "" }), _jsx("button", { type: "button", "aria-label": passwordVisible ? t("hidePassword") : t("showPassword"), onClick: () => setPasswordVisible(!passwordVisible), className: "text-muted-foreground hover:text-foreground absolute inset-y-0 top-1 right-3 flex items-center justify-center p-1 text-sm", children: passwordVisible ? (_jsx(EyeOff, { className: "h-4 w-4" })) : (_jsx(Eye, { className: "h-4 w-4" })) })] }), _jsx(EnhancedInput, { error: errors.phone, id: "phone", info: t("formPhoneInfo"), label: t("formPhoneLabel"), onChange: (e) => {
55
+ return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedInput, { error: errors.name, id: "name", info: t("formNameInfo"), label: t("formNameLabel"), onChange: (e) => handleChange("name", e.target.value), placeholder: t("formNamePlaceholder"), required: true, value: name || "" }), _jsx(EnhancedInput, { error: errors.email, id: "email", info: t("formEmailInfo"), label: t("formEmailLabel"), onChange: (e) => handleChange("email", e.target.value), placeholder: t("formEmailPlaceholder"), required: true, type: "email", value: email }), _jsxs("div", { className: "relative", children: [_jsx(EnhancedInput, { error: errors.password, id: "password", info: t("formPasswordInfo"), label: t("formPasswordLabel"), onChange: (e) => handleChange("password", e.target.value), placeholder: t("formPasswordPlaceholder"), type: passwordVisible ? "text" : "password", value: password || "" }), _jsx("button", { type: "button", "aria-label": passwordVisible ? t("actionHidePassword") : t("actionShowPassword"), onClick: () => setPasswordVisible(!passwordVisible), className: "text-muted-foreground hover:text-foreground absolute inset-y-0 top-1 right-3 flex items-center justify-center p-1 text-sm", children: passwordVisible ? (_jsx(EyeOff, { className: "h-4 w-4" })) : (_jsx(Eye, { className: "h-4 w-4" })) })] }), _jsx(EnhancedInput, { error: errors.phone, id: "phone", info: t("formPhoneInfo"), label: t("formPhoneLabel"), onChange: (e) => {
56
56
  var _a;
57
57
  return handleChange("phone", ((_a = formatPhone(e.target.value)) === null || _a === void 0 ? void 0 : _a.international) || e.target.value);
58
58
  }, placeholder: t("formPhonePlaceholder"), type: "tel", value: phone || "" }), _jsx(EnhancedDropzone, { accept: ["image/*"], error: errors.avatar, id: "avatar", info: t("formAvatarInfo"), label: t("formAvatarLabel"), maxFiles: 1, maxSize: 0.25 * 1024 * 1024, onChange: handleAvatar, onRemoveRemote: () => handleChange("avatar", ""), resize: true, value: avatar ? [avatar] : [] }), _jsx(EnhancedCheckbox, { checked: enabled, error: errors.enabled, id: "enabled", info: t("formEnabledInfo"), label: t("formActiveUserLabel"), onCheckedChange: (checked) => handleChange("enabled", checked) }), userRoleCombo] }));
@@ -9,5 +9,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { useTranslations } from "next-intl";
10
10
  export const WorkspaceFilter = () => {
11
11
  const t = useTranslations("workspace");
12
- return (_jsx("div", { className: "p-6 text-center text-muted-foreground", children: _jsx("p", { children: t("filter") }) }));
12
+ return (_jsx("div", { className: "p-6 text-center text-muted-foreground", children: _jsx("p", { children: t("filterFallbackText") }) }));
13
13
  };
@@ -9,5 +9,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { useTranslations } from "next-intl";
10
10
  export const WorkspaceMoreActions = () => {
11
11
  const t = useTranslations("workspace");
12
- return (_jsx("div", { className: "p-6 text-center text-muted-foreground", children: _jsx("p", { children: t("moreActions") }) }));
12
+ return (_jsx("div", { className: "p-6 text-center text-muted-foreground", children: _jsx("p", { children: t("moreActionsFallbackText") }) }));
13
13
  };
@@ -40,11 +40,11 @@ export const WorkspaceView = () => {
40
40
  return `${mb} MB`;
41
41
  return `${(mb / 1024).toFixed(1)} GB`;
42
42
  };
43
- return (_jsxs("div", { className: "space-y-6", children: [_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("viewSectionBasicInfo") })] }), _jsx(CardDescription, { children: t("viewBasicInfoDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-2 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsName") })] }), _jsx("p", { className: "text-base", children: formatValue(state.name) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Globe, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsSubdomain") })] }), _jsx("p", { className: "text-base", children: formatValue(state.subdomain) }), state.subdomain && (_jsxs("p", { className: "text-muted-foreground text-sm", children: [t("viewFieldUrlPrefix"), state.subdomain, ".edupilotpro.com"] }))] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsDescription") })] }), _jsx("p", { className: "text-base", children: formatValue(state.description) === "—"
43
+ return (_jsxs("div", { className: "space-y-6", children: [_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("viewSectionBasicInfo") })] }), _jsx(CardDescription, { children: t("viewBasicInfoDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-2 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldName") })] }), _jsx("p", { className: "text-base", children: formatValue(state.name) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Globe, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldSubdomain") })] }), _jsx("p", { className: "text-base", children: formatValue(state.subdomain) }), state.subdomain && (_jsxs("p", { className: "text-muted-foreground text-sm", children: [t("viewFieldUrlPrefix"), state.subdomain, ".edupilotpro.com"] }))] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldDescription") })] }), _jsx("p", { className: "text-base", children: formatValue(state.description) === "—"
44
44
  ? t("viewTextDescriptionNotProvided")
45
- : state.description })] }), state.logo && (_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(LucideImage, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsLogo") })] }), _jsx("div", { className: "mt-2", children: _jsx(Image, { src: state.logo, alt: t("viewLabelsLogoAlt"), width: 64, height: 64, className: "h-16 w-16 rounded border object-contain", onError: (e) => {
45
+ : state.description })] }), state.logo && (_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(LucideImage, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldLogo") })] }), _jsx("div", { className: "mt-2", children: _jsx(Image, { src: state.logo, alt: t("viewFieldLogoAlt"), width: 64, height: 64, className: "h-16 w-16 rounded border object-contain", onError: (e) => {
46
46
  e.currentTarget.style.display = "none";
47
- } }) })] })), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewLabelsStatus") }), _jsxs(Badge, { variant: state.enabled ? "default" : "destructive", className: "gap-1", children: [state.enabled ? (_jsx(CheckCircle2, { className: "h-3 w-3" })) : (_jsx(XCircle, { className: "h-3 w-3" })), state.enabled
47
+ } }) })] })), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsxs(Badge, { variant: state.enabled ? "default" : "destructive", className: "gap-1", children: [state.enabled ? (_jsx(CheckCircle2, { className: "h-3 w-3" })) : (_jsx(XCircle, { className: "h-3 w-3" })), state.enabled
48
48
  ? t("viewStatusEnabled")
49
49
  : t("viewStatusDisabled")] })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CreditCard, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionPlanBilling") })] }), _jsx(CardDescription, { children: t("viewPlanBillingDescription") })] }), _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(CreditCard, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldPlanIdLabel") })] }), _jsx("p", { className: "font-mono text-sm", children: formatValue(state.planId) })] }), _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("viewFieldPlanStartDateLabel") })] }), _jsx("p", { className: "text-base", children: formatDate(state.planStartDate || "", DATE_FORMATS.LOCALE_DATE) })] }), _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("viewFieldPlanEndDateLabel") })] }), _jsx("p", { className: "text-base", children: formatDate(state.planEndDate || "", DATE_FORMATS.LOCALE_DATE) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Clock, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldBillingIntervalLabel") })] }), _jsx("p", { className: "text-base", children: formatBillingInterval(state.billingInterval) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CreditCard, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldAgreedPriceLabel") })] }), _jsx("p", { className: "text-base", children: formatCurrency(state.agreedPrice, state.agreedCurrency) })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Globe, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCurrencyLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(state.agreedCurrency) })] })] }) })] }), _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("viewSectionUsageStats") })] }), _jsx(CardDescription, { children: t("viewUsageStatsDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-2 gap-6 md:grid-cols-3", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(GraduationCap, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStudentsLabel") })] }), _jsx("p", { className: "text-primary text-2xl font-bold", children: state.studentsCount })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Users, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldTeachersLabel") })] }), _jsx("p", { className: "text-primary text-2xl font-bold", children: state.teachersCount })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(BookOpen, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldClassesLabel") })] }), _jsx("p", { className: "text-primary text-2xl font-bold", children: state.classesCount })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(BookOpen, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCoursesLabel") })] }), _jsx("p", { className: "text-primary text-2xl font-bold", children: state.coursesCount })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Home, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldFamiliesLabel") })] }), _jsx("p", { className: "text-primary text-2xl font-bold", children: state.familiesCount })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(HardDrive, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStorageUsedLabel") })] }), _jsx("p", { className: "text-primary text-2xl font-bold", children: formatStorage(state.storageUsedMB) })] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Shield, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionSecrets") })] }), _jsx(CardDescription, { children: t("viewSecretsDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsx("div", { className: "space-y-4", children: _jsxs("div", { children: [_jsxs("div", { className: "mb-2 flex items-center gap-2", children: [_jsx(Shield, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldSecretsJsonLabel") })] }), state.secrets ? (_jsx("div", { className: "space-y-2", children: Object.keys(state.secrets)
50
50
  .length === 0 ? (_jsx("p", { className: "text-muted-foreground italic", children: t("viewFieldNoSecretsConfigured") })) : (Object.entries(state.secrets).map(([k, v]) => (_jsxs("div", { className: "bg-muted/10 border-border/60 flex items-center justify-between rounded-md border p-3", children: [_jsx("div", { className: "text-foreground text-sm font-medium", children: k }), _jsx("div", { className: "text-foreground/80 font-mono text-sm", children: typeof v === "string" && v.length > 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.2.65",
3
+ "version": "0.2.67",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",