@hed-hog/operations 0.0.294 → 0.0.296

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.
Files changed (126) hide show
  1. package/dist/operations.controller.d.ts +415 -0
  2. package/dist/operations.controller.d.ts.map +1 -0
  3. package/dist/operations.controller.js +333 -0
  4. package/dist/operations.controller.js.map +1 -0
  5. package/dist/operations.module.d.ts.map +1 -1
  6. package/dist/operations.module.js +4 -3
  7. package/dist/operations.module.js.map +1 -1
  8. package/dist/operations.service.d.ts +589 -153
  9. package/dist/operations.service.d.ts.map +1 -1
  10. package/dist/operations.service.js +2229 -100
  11. package/dist/operations.service.js.map +1 -1
  12. package/hedhog/data/menu.yaml +198 -251
  13. package/hedhog/data/role.yaml +23 -14
  14. package/hedhog/data/route.yaml +317 -143
  15. package/hedhog/frontend/app/_components/collaborator-details-screen.tsx.ejs +310 -0
  16. package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +631 -0
  17. package/hedhog/frontend/app/_components/contract-details-screen.tsx.ejs +132 -0
  18. package/hedhog/frontend/app/_components/contract-form-screen.tsx.ejs +558 -0
  19. package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +291 -0
  20. package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +689 -0
  21. package/hedhog/frontend/app/_lib/api.ts.ejs +32 -0
  22. package/hedhog/frontend/app/_lib/hooks/use-operations-access.ts.ejs +44 -0
  23. package/hedhog/frontend/app/_lib/types.ts.ejs +360 -0
  24. package/hedhog/frontend/app/_lib/utils/format.ts.ejs +129 -25
  25. package/hedhog/frontend/app/_lib/utils/forms.ts.ejs +14 -0
  26. package/hedhog/frontend/app/approvals/page.tsx.ejs +386 -147
  27. package/hedhog/frontend/app/collaborators/[id]/edit/page.tsx.ejs +11 -0
  28. package/hedhog/frontend/app/collaborators/[id]/page.tsx.ejs +11 -0
  29. package/hedhog/frontend/app/collaborators/new/page.tsx.ejs +5 -0
  30. package/hedhog/frontend/app/collaborators/page.tsx.ejs +261 -0
  31. package/hedhog/frontend/app/contracts/[id]/edit/page.tsx.ejs +11 -0
  32. package/hedhog/frontend/app/contracts/[id]/page.tsx.ejs +11 -108
  33. package/hedhog/frontend/app/contracts/new/page.tsx.ejs +17 -0
  34. package/hedhog/frontend/app/contracts/page.tsx.ejs +262 -181
  35. package/hedhog/frontend/app/page.tsx.ejs +319 -177
  36. package/hedhog/frontend/app/projects/[id]/edit/page.tsx.ejs +11 -0
  37. package/hedhog/frontend/app/projects/[id]/page.tsx.ejs +11 -936
  38. package/hedhog/frontend/app/projects/new/page.tsx.ejs +5 -0
  39. package/hedhog/frontend/app/projects/page.tsx.ejs +236 -1074
  40. package/hedhog/frontend/app/schedule-adjustments/page.tsx.ejs +418 -0
  41. package/hedhog/frontend/app/team/page.tsx.ejs +339 -0
  42. package/hedhog/frontend/app/time-off/page.tsx.ejs +328 -0
  43. package/hedhog/frontend/app/timesheets/page.tsx.ejs +636 -126
  44. package/hedhog/frontend/messages/en.json +648 -454
  45. package/hedhog/frontend/messages/pt.json +647 -454
  46. package/hedhog/table/operations_approval.yaml +49 -0
  47. package/hedhog/table/operations_approval_history.yaml +29 -0
  48. package/hedhog/table/{operations_employee.yaml → operations_collaborator.yaml} +67 -64
  49. package/hedhog/table/operations_collaborator_schedule_day.yaml +34 -0
  50. package/hedhog/table/operations_contract.yaml +100 -48
  51. package/hedhog/table/operations_contract_document.yaml +39 -0
  52. package/hedhog/table/operations_contract_financial_term.yaml +40 -0
  53. package/hedhog/table/operations_contract_history.yaml +27 -0
  54. package/hedhog/table/operations_contract_party.yaml +46 -0
  55. package/hedhog/table/operations_contract_revision.yaml +38 -0
  56. package/hedhog/table/operations_contract_signature.yaml +38 -0
  57. package/hedhog/table/operations_project.yaml +54 -50
  58. package/hedhog/table/{operations_allocation.yaml → operations_project_assignment.yaml} +55 -52
  59. package/hedhog/table/operations_schedule_adjustment_day.yaml +34 -0
  60. package/hedhog/table/operations_schedule_adjustment_request.yaml +53 -0
  61. package/hedhog/table/operations_time_off_request.yaml +57 -0
  62. package/hedhog/table/operations_timesheet.yaml +41 -36
  63. package/hedhog/table/operations_timesheet_entry.yaml +40 -50
  64. package/package.json +7 -6
  65. package/src/operations.controller.ts +182 -0
  66. package/src/operations.module.ts +22 -21
  67. package/src/operations.service.ts +3595 -137
  68. package/hedhog/data/operations_career_level.yaml +0 -102
  69. package/hedhog/data/operations_career_track.yaml +0 -8
  70. package/hedhog/data/operations_certification.yaml +0 -38
  71. package/hedhog/data/operations_evaluation_cycle.yaml +0 -18
  72. package/hedhog/data/operations_performance_criterion.yaml +0 -48
  73. package/hedhog/frontend/app/_components/allocation-calendar.tsx.ejs +0 -56
  74. package/hedhog/frontend/app/_components/kanban-board.tsx.ejs +0 -626
  75. package/hedhog/frontend/app/_components/timesheet-entry-dialog.tsx.ejs +0 -142
  76. package/hedhog/frontend/app/_lib/hooks/use-operations-data.ts.ejs +0 -41
  77. package/hedhog/frontend/app/_lib/hooks/use-operations-growth-data.ts.ejs +0 -63
  78. package/hedhog/frontend/app/_lib/mocks/allocations.mock.ts.ejs +0 -74
  79. package/hedhog/frontend/app/_lib/mocks/contracts.mock.ts.ejs +0 -74
  80. package/hedhog/frontend/app/_lib/mocks/operations-growth.mock.ts.ejs +0 -824
  81. package/hedhog/frontend/app/_lib/mocks/projects.mock.ts.ejs +0 -455
  82. package/hedhog/frontend/app/_lib/mocks/tasks.mock.ts.ejs +0 -117
  83. package/hedhog/frontend/app/_lib/mocks/timesheets.mock.ts.ejs +0 -84
  84. package/hedhog/frontend/app/_lib/mocks/users.mock.ts.ejs +0 -67
  85. package/hedhog/frontend/app/_lib/services/contracts.service.ts.ejs +0 -10
  86. package/hedhog/frontend/app/_lib/services/operations-growth.service.ts.ejs +0 -31
  87. package/hedhog/frontend/app/_lib/services/projects.service.ts.ejs +0 -10
  88. package/hedhog/frontend/app/_lib/services/tasks.service.ts.ejs +0 -10
  89. package/hedhog/frontend/app/_lib/services/timesheets.service.ts.ejs +0 -10
  90. package/hedhog/frontend/app/_lib/types/operations-growth.ts.ejs +0 -209
  91. package/hedhog/frontend/app/_lib/types/operations.ts.ejs +0 -156
  92. package/hedhog/frontend/app/_lib/utils/growth.ts.ejs +0 -62
  93. package/hedhog/frontend/app/_lib/utils/metrics.ts.ejs +0 -103
  94. package/hedhog/frontend/app/_lib/utils/status.ts.ejs +0 -80
  95. package/hedhog/frontend/app/allocations/page.tsx.ejs +0 -155
  96. package/hedhog/frontend/app/career/page.tsx.ejs +0 -143
  97. package/hedhog/frontend/app/certifications/page.tsx.ejs +0 -202
  98. package/hedhog/frontend/app/evaluations/page.tsx.ejs +0 -278
  99. package/hedhog/frontend/app/goals/page.tsx.ejs +0 -171
  100. package/hedhog/frontend/app/growth/page.tsx.ejs +0 -288
  101. package/hedhog/frontend/app/manager/page.tsx.ejs +0 -175
  102. package/hedhog/frontend/app/rewards/page.tsx.ejs +0 -196
  103. package/hedhog/frontend/app/tasks/page.tsx.ejs +0 -999
  104. package/hedhog/table/operations_calibration_item.yaml +0 -61
  105. package/hedhog/table/operations_calibration_session.yaml +0 -25
  106. package/hedhog/table/operations_career_level.yaml +0 -75
  107. package/hedhog/table/operations_career_track.yaml +0 -21
  108. package/hedhog/table/operations_certification.yaml +0 -48
  109. package/hedhog/table/operations_employee_certification.yaml +0 -43
  110. package/hedhog/table/operations_employee_connect.yaml +0 -61
  111. package/hedhog/table/operations_employee_evaluation.yaml +0 -113
  112. package/hedhog/table/operations_employee_evaluation_item.yaml +0 -39
  113. package/hedhog/table/operations_employee_profile.yaml +0 -80
  114. package/hedhog/table/operations_employee_skill_matrix.yaml +0 -30
  115. package/hedhog/table/operations_evaluation_cycle.yaml +0 -31
  116. package/hedhog/table/operations_goal.yaml +0 -67
  117. package/hedhog/table/operations_goal_progress.yaml +0 -31
  118. package/hedhog/table/operations_performance_criterion.yaml +0 -29
  119. package/hedhog/table/operations_promotion_readiness.yaml +0 -49
  120. package/hedhog/table/operations_promotion_recommendation.yaml +0 -63
  121. package/hedhog/table/operations_public_recognition.yaml +0 -46
  122. package/hedhog/table/operations_reward.yaml +0 -100
  123. package/hedhog/table/operations_score_event.yaml +0 -81
  124. package/hedhog/table/operations_task.yaml +0 -60
  125. package/src/operations-data.controller.ts +0 -54
  126. package/src/operations-growth.controller.ts +0 -44
@@ -1,177 +1,319 @@
1
- 'use client';
2
-
3
- import { Page } from '@/components/entity-list';
4
- import { KpiCard } from '@/components/ui/kpi-card';
5
- import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
6
- import { Activity, BadgeDollarSign, Clock3, FolderKanban, Users } from 'lucide-react';
7
- import { useTranslations } from 'next-intl';
8
- import {
9
- Bar,
10
- BarChart,
11
- CartesianGrid,
12
- Cell,
13
- Line,
14
- LineChart,
15
- Pie,
16
- PieChart,
17
- ResponsiveContainer,
18
- Tooltip,
19
- XAxis,
20
- YAxis,
21
- } from 'recharts';
22
- import { OperationsHeader } from './_components/operations-header';
23
- import { SectionCard } from './_components/section-card';
24
- import { StatusBadge } from './_components/status-badge';
25
- import { useOperationsData } from './_lib/hooks/use-operations-data';
26
- import { formatCurrency, formatHours } from './_lib/utils/format';
27
- import { getApprovalBadgeClasses, getApprovalLabel } from './_lib/utils/status';
28
-
29
- const chartColors = ['#0f766e', '#1d4ed8', '#f97316', '#be123c', '#7c3aed'];
30
-
31
- export default function OperationsDashboardPage() {
32
- const t = useTranslations('operations.DashboardPage');
33
- const {
34
- dashboardMetrics,
35
- hoursByProject,
36
- hoursByUser,
37
- approvalStatusData,
38
- weeklyTrendData,
39
- recentTimesheets,
40
- users,
41
- projects,
42
- tasks,
43
- } = useOperationsData();
44
-
45
- return (
46
- <Page>
47
- <OperationsHeader
48
- title={t('title')}
49
- description={t('description')}
50
- current={t('breadcrumb')}
51
- />
52
-
53
- <div className="grid gap-4 md:grid-cols-2 xl:grid-cols-5">
54
- <KpiCard
55
- title={t('cards.activeProjects')}
56
- value={dashboardMetrics.totalActiveProjects}
57
- icon={FolderKanban}
58
- />
59
- <KpiCard
60
- title={t('cards.loggedHours')}
61
- value={formatHours(dashboardMetrics.hoursLoggedThisMonth)}
62
- icon={Clock3}
63
- />
64
- <KpiCard
65
- title={t('cards.pendingHours')}
66
- value={formatHours(dashboardMetrics.hoursPendingApproval)}
67
- icon={Activity}
68
- />
69
- <KpiCard
70
- title={t('cards.revenue')}
71
- value={formatCurrency(dashboardMetrics.revenue)}
72
- icon={BadgeDollarSign}
73
- />
74
- <KpiCard
75
- title={t('cards.utilization')}
76
- value={`${dashboardMetrics.utilization.toFixed(0)}%`}
77
- icon={Users}
78
- />
79
- </div>
80
-
81
- <div className="grid gap-4 xl:grid-cols-2">
82
- <SectionCard title={t('charts.hoursByProject')} description={t('charts.hoursByProjectDescription')}>
83
- <ResponsiveContainer width="100%" height={280}>
84
- <BarChart data={hoursByProject}>
85
- <CartesianGrid strokeDasharray="3 3" className="stroke-muted" />
86
- <XAxis dataKey="name" tick={{ fontSize: 11 }} interval={0} angle={-15} textAnchor="end" height={55} />
87
- <YAxis />
88
- <Tooltip />
89
- <Bar dataKey="hours" radius={[6, 6, 0, 0]}>
90
- {hoursByProject.map((item, index) => (
91
- <Cell key={item.name} fill={chartColors[index % chartColors.length]} />
92
- ))}
93
- </Bar>
94
- </BarChart>
95
- </ResponsiveContainer>
96
- </SectionCard>
97
-
98
- <SectionCard title={t('charts.hoursByUser')} description={t('charts.hoursByUserDescription')}>
99
- <ResponsiveContainer width="100%" height={280}>
100
- <BarChart data={hoursByUser}>
101
- <CartesianGrid strokeDasharray="3 3" className="stroke-muted" />
102
- <XAxis dataKey="name" />
103
- <YAxis />
104
- <Tooltip />
105
- <Bar dataKey="hours" radius={[6, 6, 0, 0]}>
106
- {hoursByUser.map((item, index) => (
107
- <Cell key={item.name} fill={chartColors[index % chartColors.length]} />
108
- ))}
109
- </Bar>
110
- </BarChart>
111
- </ResponsiveContainer>
112
- </SectionCard>
113
-
114
- <SectionCard title={t('charts.approvalStatus')} description={t('charts.approvalStatusDescription')}>
115
- <ResponsiveContainer width="100%" height={280}>
116
- <PieChart>
117
- <Pie data={approvalStatusData} dataKey="value" nameKey="name" outerRadius={110}>
118
- {approvalStatusData.map((item, index) => (
119
- <Cell key={item.name} fill={chartColors[index % chartColors.length]} />
120
- ))}
121
- </Pie>
122
- <Tooltip />
123
- </PieChart>
124
- </ResponsiveContainer>
125
- </SectionCard>
126
-
127
- <SectionCard title={t('charts.weeklyTrend')} description={t('charts.weeklyTrendDescription')}>
128
- <ResponsiveContainer width="100%" height={280}>
129
- <LineChart data={weeklyTrendData}>
130
- <CartesianGrid strokeDasharray="3 3" className="stroke-muted" />
131
- <XAxis dataKey="week" />
132
- <YAxis />
133
- <Tooltip />
134
- <Line dataKey="hours" type="monotone" stroke="#1d4ed8" strokeWidth={3} />
135
- </LineChart>
136
- </ResponsiveContainer>
137
- </SectionCard>
138
- </div>
139
-
140
- <SectionCard title={t('recentTable.title')} description={t('recentTable.description')}>
141
- <Table>
142
- <TableHeader>
143
- <TableRow>
144
- <TableHead>{t('recentTable.user')}</TableHead>
145
- <TableHead>{t('recentTable.project')}</TableHead>
146
- <TableHead>{t('recentTable.task')}</TableHead>
147
- <TableHead>{t('recentTable.hours')}</TableHead>
148
- <TableHead>{t('recentTable.status')}</TableHead>
149
- </TableRow>
150
- </TableHeader>
151
- <TableBody>
152
- {recentTimesheets.map((entry) => {
153
- const user = users.find((item) => item.id === entry.userId);
154
- const project = projects.find((item) => item.id === entry.projectId);
155
- const task = tasks.find((item) => item.id === entry.taskId);
156
-
157
- return (
158
- <TableRow key={entry.id}>
159
- <TableCell>{user?.name}</TableCell>
160
- <TableCell>{project?.name}</TableCell>
161
- <TableCell>{task?.title}</TableCell>
162
- <TableCell>{formatHours(entry.hours)}</TableCell>
163
- <TableCell>
164
- <StatusBadge
165
- label={getApprovalLabel(entry.status)}
166
- className={getApprovalBadgeClasses(entry.status)}
167
- />
168
- </TableCell>
169
- </TableRow>
170
- );
171
- })}
172
- </TableBody>
173
- </Table>
174
- </SectionCard>
175
- </Page>
176
- );
177
- }
1
+ 'use client';
2
+
3
+ import { EmptyState, Page } from '@/components/entity-list';
4
+ import { Button } from '@/components/ui/button';
5
+ import { KpiCardsGrid } from '@/components/ui/kpi-cards-grid';
6
+ import { Skeleton } from '@/components/ui/skeleton';
7
+ import {
8
+ Table,
9
+ TableBody,
10
+ TableCell,
11
+ TableHead,
12
+ TableHeader,
13
+ TableRow,
14
+ } from '@/components/ui/table';
15
+ import { useApp, useQuery } from '@hed-hog/next-app-provider';
16
+ import {
17
+ CheckCircle2,
18
+ ClipboardList,
19
+ FolderKanban,
20
+ Hourglass,
21
+ PlaneTakeoff,
22
+ RefreshCcw,
23
+ Users,
24
+ } from 'lucide-react';
25
+ import Link from 'next/link';
26
+ import { useTranslations } from 'next-intl';
27
+ import { OperationsHeader } from './_components/operations-header';
28
+ import { SectionCard } from './_components/section-card';
29
+ import { StatusBadge } from './_components/status-badge';
30
+ import { fetchOperations } from './_lib/api';
31
+ import { useOperationsAccess } from './_lib/hooks/use-operations-access';
32
+ import type { OperationsDashboard, OperationsTeamOverview } from './_lib/types';
33
+ import {
34
+ formatDate,
35
+ formatDateRange,
36
+ formatEnumLabel,
37
+ formatHours,
38
+ getStatusBadgeClass,
39
+ } from './_lib/utils/format';
40
+
41
+ export default function OperationsDashboardPage() {
42
+ const t = useTranslations('operations.DashboardPage');
43
+ const commonT = useTranslations('operations.Common');
44
+ const { request, currentLocaleCode } = useApp();
45
+ const access = useOperationsAccess();
46
+
47
+ const {
48
+ data: dashboard,
49
+ isLoading,
50
+ refetch,
51
+ } = useQuery<OperationsDashboard>({
52
+ queryKey: ['operations-dashboard', currentLocaleCode],
53
+ queryFn: () => fetchOperations<OperationsDashboard>(request, '/operations/dashboard'),
54
+ });
55
+
56
+ const { data: team } = useQuery<OperationsTeamOverview>({
57
+ queryKey: ['operations-team-overview', currentLocaleCode],
58
+ enabled: access.isSupervisor,
59
+ queryFn: () => fetchOperations<OperationsTeamOverview>(request, '/operations/team'),
60
+ });
61
+
62
+ const cards = dashboard
63
+ ? [
64
+ {
65
+ key: 'projects',
66
+ title: t('cards.projects'),
67
+ value: dashboard.cards.projectsTotal,
68
+ description: t('cards.projectsDescription', {
69
+ active: dashboard.cards.activeProjects,
70
+ }),
71
+ icon: FolderKanban,
72
+ },
73
+ {
74
+ key: 'timesheets',
75
+ title: t('cards.timesheets'),
76
+ value: dashboard.cards.visibleTimesheets,
77
+ description: t('cards.timesheetsDescription', {
78
+ pending: dashboard.cards.pendingTimesheets,
79
+ }),
80
+ icon: ClipboardList,
81
+ },
82
+ {
83
+ key: 'timeOff',
84
+ title: t('cards.timeOff'),
85
+ value: dashboard.cards.timeOffRequests,
86
+ description: t('cards.timeOffDescription'),
87
+ icon: PlaneTakeoff,
88
+ },
89
+ {
90
+ key: 'approvals',
91
+ title: t('cards.approvals'),
92
+ value: dashboard.cards.pendingApprovals,
93
+ description: t('cards.approvalsDescription'),
94
+ icon: Hourglass,
95
+ },
96
+ ]
97
+ : [];
98
+
99
+ return (
100
+ <Page>
101
+ <OperationsHeader
102
+ title={t('title')}
103
+ description={t('description')}
104
+ current={t('breadcrumb')}
105
+ actions={
106
+ <div className="flex gap-2">
107
+ <Button variant="outline" size="sm" onClick={() => void refetch()}>
108
+ <RefreshCcw className="size-4" />
109
+ {commonT('actions.refresh')}
110
+ </Button>
111
+ <Button asChild size="sm">
112
+ <Link href="/operations/timesheets">{t('actions.openTimesheets')}</Link>
113
+ </Button>
114
+ </div>
115
+ }
116
+ />
117
+
118
+ {isLoading || access.isLoading ? (
119
+ <div className="space-y-4">
120
+ <div className="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
121
+ {Array.from({ length: 4 }).map((_, index) => (
122
+ <Skeleton key={index} className="h-32 w-full" />
123
+ ))}
124
+ </div>
125
+ <div className="grid gap-4 xl:grid-cols-3">
126
+ <Skeleton className="h-64 w-full xl:col-span-2" />
127
+ <Skeleton className="h-64 w-full" />
128
+ </div>
129
+ </div>
130
+ ) : dashboard ? (
131
+ <>
132
+ <KpiCardsGrid items={cards} />
133
+
134
+ <div className="grid gap-4 xl:grid-cols-3">
135
+ <SectionCard
136
+ title={t('scope.title')}
137
+ description={t('scope.description')}
138
+ className="xl:col-span-1"
139
+ >
140
+ <dl className="space-y-3 text-sm">
141
+ <div className="flex items-center justify-between gap-4">
142
+ <dt className="text-muted-foreground">{t('scope.roleScope')}</dt>
143
+ <dd className="font-medium">
144
+ {formatEnumLabel(dashboard.actor.roleScope)}
145
+ </dd>
146
+ </div>
147
+ <div className="flex items-center justify-between gap-4">
148
+ <dt className="text-muted-foreground">{t('scope.collaborator')}</dt>
149
+ <dd className="font-medium">
150
+ {dashboard.actor.collaboratorName ?? commonT('labels.notAvailable')}
151
+ </dd>
152
+ </div>
153
+ <div className="flex items-center justify-between gap-4">
154
+ <dt className="text-muted-foreground">{t('scope.teamSize')}</dt>
155
+ <dd className="font-medium">{dashboard.actor.teamSize}</dd>
156
+ </div>
157
+ </dl>
158
+ </SectionCard>
159
+
160
+ <SectionCard
161
+ title={t('recentTimesheets.title')}
162
+ description={t('recentTimesheets.description')}
163
+ className="xl:col-span-2"
164
+ >
165
+ {dashboard.recentTimesheets.length === 0 ? (
166
+ <EmptyState
167
+ icon={<ClipboardList className="size-12" />}
168
+ title={commonT('states.emptyTitle')}
169
+ description={t('recentTimesheets.empty')}
170
+ actionLabel={t('actions.openTimesheets')}
171
+ onAction={() => {
172
+ window.location.href = '/operations/timesheets';
173
+ }}
174
+ />
175
+ ) : (
176
+ <div className="overflow-x-auto rounded-md border">
177
+ <Table>
178
+ <TableHeader>
179
+ <TableRow>
180
+ <TableHead>{commonT('labels.collaborator')}</TableHead>
181
+ <TableHead>{commonT('labels.week')}</TableHead>
182
+ <TableHead>{commonT('labels.totalHours')}</TableHead>
183
+ <TableHead>{commonT('labels.status')}</TableHead>
184
+ </TableRow>
185
+ </TableHeader>
186
+ <TableBody>
187
+ {dashboard.recentTimesheets.map((item) => (
188
+ <TableRow key={item.id}>
189
+ <TableCell className="font-medium">
190
+ {item.collaboratorName}
191
+ </TableCell>
192
+ <TableCell>
193
+ {formatDateRange(item.weekStartDate, item.weekEndDate)}
194
+ </TableCell>
195
+ <TableCell>{formatHours(item.totalHours)}</TableCell>
196
+ <TableCell>
197
+ <StatusBadge
198
+ label={formatEnumLabel(item.status)}
199
+ className={getStatusBadgeClass(item.status)}
200
+ />
201
+ </TableCell>
202
+ </TableRow>
203
+ ))}
204
+ </TableBody>
205
+ </Table>
206
+ </div>
207
+ )}
208
+ </SectionCard>
209
+ </div>
210
+
211
+ <div className="grid gap-4 xl:grid-cols-2">
212
+ <SectionCard
213
+ title={t('nextSteps.title')}
214
+ description={t('nextSteps.description')}
215
+ >
216
+ <div className="space-y-3 text-sm">
217
+ <div className="flex items-start gap-3">
218
+ <CheckCircle2 className="mt-0.5 size-4 text-emerald-600" />
219
+ <p>{t('nextSteps.submitTimesheet')}</p>
220
+ </div>
221
+ <div className="flex items-start gap-3">
222
+ <CheckCircle2 className="mt-0.5 size-4 text-emerald-600" />
223
+ <p>{t('nextSteps.requestTimeOff')}</p>
224
+ </div>
225
+ <div className="flex items-start gap-3">
226
+ <CheckCircle2 className="mt-0.5 size-4 text-emerald-600" />
227
+ <p>{t('nextSteps.adjustSchedule')}</p>
228
+ </div>
229
+ </div>
230
+ </SectionCard>
231
+
232
+ <SectionCard
233
+ title={t('team.title')}
234
+ description={t('team.description')}
235
+ >
236
+ {access.isSupervisor && team ? (
237
+ <>
238
+ <div className="mb-4 grid gap-3 md:grid-cols-3">
239
+ <div className="rounded-lg border p-4">
240
+ <div className="text-xs uppercase tracking-[0.2em] text-muted-foreground">
241
+ {t('team.members')}
242
+ </div>
243
+ <div className="mt-2 text-2xl font-semibold">
244
+ {team.teamMembers.length}
245
+ </div>
246
+ </div>
247
+ <div className="rounded-lg border p-4">
248
+ <div className="text-xs uppercase tracking-[0.2em] text-muted-foreground">
249
+ {t('team.projects')}
250
+ </div>
251
+ <div className="mt-2 text-2xl font-semibold">
252
+ {team.projectCount}
253
+ </div>
254
+ </div>
255
+ <div className="rounded-lg border p-4">
256
+ <div className="text-xs uppercase tracking-[0.2em] text-muted-foreground">
257
+ {t('team.pendingApprovals')}
258
+ </div>
259
+ <div className="mt-2 text-2xl font-semibold">
260
+ {team.pendingApprovals}
261
+ </div>
262
+ </div>
263
+ </div>
264
+
265
+ {team.teamMembers.length > 0 ? (
266
+ <div className="space-y-3">
267
+ {team.teamMembers.slice(0, 4).map((member) => (
268
+ <div
269
+ key={member.id}
270
+ className="flex items-center justify-between rounded-lg border px-4 py-3 text-sm"
271
+ >
272
+ <div>
273
+ <div className="font-medium">{member.displayName}</div>
274
+ <div className="text-muted-foreground">
275
+ {[member.department, member.title]
276
+ .filter(Boolean)
277
+ .join(' • ') || commonT('labels.notAvailable')}
278
+ </div>
279
+ </div>
280
+ <div className="text-right">
281
+ <div className="font-medium">
282
+ {member.activeAssignments ?? 0}{' '}
283
+ {t('team.assignments')}
284
+ </div>
285
+ <div className="text-muted-foreground">
286
+ {member.pendingApprovals ?? 0}{' '}
287
+ {t('team.awaitingReview')}
288
+ </div>
289
+ </div>
290
+ </div>
291
+ ))}
292
+ </div>
293
+ ) : (
294
+ <p className="text-sm text-muted-foreground">
295
+ {t('team.empty')}
296
+ </p>
297
+ )}
298
+ </>
299
+ ) : (
300
+ <div className="flex items-start gap-3 rounded-lg border border-dashed p-4 text-sm text-muted-foreground">
301
+ <Users className="mt-0.5 size-4" />
302
+ <p>{t('team.collaboratorMessage')}</p>
303
+ </div>
304
+ )}
305
+ </SectionCard>
306
+ </div>
307
+ </>
308
+ ) : (
309
+ <EmptyState
310
+ icon={<FolderKanban className="size-12" />}
311
+ title={commonT('states.emptyTitle')}
312
+ description={commonT('states.emptyDescription')}
313
+ actionLabel={commonT('actions.refresh')}
314
+ onAction={() => void refetch()}
315
+ />
316
+ )}
317
+ </Page>
318
+ );
319
+ }
@@ -0,0 +1,11 @@
1
+ import { ProjectFormScreen } from '../../../_components/project-form-screen';
2
+
3
+ export default async function OperationsProjectEditPage({
4
+ params,
5
+ }: {
6
+ params: Promise<{ id: string }>;
7
+ }) {
8
+ const { id } = await params;
9
+
10
+ return <ProjectFormScreen projectId={Number(id)} />;
11
+ }