@hed-hog/lms 0.0.285 → 0.0.286

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.
@@ -215,9 +215,10 @@ function generateAulas(): Aula[] {
215
215
  for (let i = -10; i < 20; i++) {
216
216
  const dia = addDays(today, i);
217
217
  if (dia.getDay() === 0 || dia.getDay() === 6) continue;
218
+ const titulo = titulos[aulas.length % titulos.length]!;
218
219
  aulas.push({
219
220
  id: aulas.length + 1,
220
- titulo: titulos[aulas.length % titulos.length],
221
+ titulo,
221
222
  data: dia,
222
223
  horaInicio: '19:00',
223
224
  horaFim: '22:00',
@@ -330,13 +331,15 @@ export default function TurmaDetalhePage() {
330
331
  // Calendar events
331
332
  const calendarEvents = useMemo(() => {
332
333
  return aulas.map((aula) => {
333
- const [hi, mi] = aula.horaInicio.split(':').map(Number);
334
- const [hf, mf] = aula.horaFim.split(':').map(Number);
334
+ const [startHour = 0, startMinute = 0] = aula.horaInicio
335
+ .split(':')
336
+ .map(Number);
337
+ const [endHour = 0, endMinute = 0] = aula.horaFim.split(':').map(Number);
335
338
  return {
336
339
  id: aula.id,
337
340
  title: aula.titulo,
338
- start: setMinutes(setHours(aula.data, hi), mi),
339
- end: setMinutes(setHours(aula.data, hf), mf),
341
+ start: setMinutes(setHours(aula.data, startHour), startMinute),
342
+ end: setMinutes(setHours(aula.data, endHour), endMinute),
340
343
  resource: aula,
341
344
  };
342
345
  });
@@ -546,7 +549,7 @@ export default function TurmaDetalhePage() {
546
549
  },
547
550
  ];
548
551
 
549
- const STATUS_MAP: Record<string, { label: string; color: string }> = {
552
+ const STATUS_MAP = {
550
553
  aberta: {
551
554
  label: tClasses('status.aberta'),
552
555
  color: 'bg-blue-100 text-blue-700 border-blue-200',
@@ -563,7 +566,9 @@ export default function TurmaDetalhePage() {
563
566
  label: tClasses('status.cancelada'),
564
567
  color: 'bg-red-100 text-red-700 border-red-200',
565
568
  },
566
- };
569
+ } as const;
570
+ const turmaStatus =
571
+ STATUS_MAP[turma.status as keyof typeof STATUS_MAP] ?? STATUS_MAP.aberta;
567
572
 
568
573
  const fadeUp = {
569
574
  hidden: { opacity: 0, y: 20 },
@@ -616,8 +621,8 @@ export default function TurmaDetalhePage() {
616
621
  >
617
622
  <div>
618
623
  <div className="flex flex-wrap items-center gap-2 mb-1">
619
- <Badge className={`${STATUS_MAP[turma.status].color} border`}>
620
- {STATUS_MAP[turma.status].label}
624
+ <Badge className={`${turmaStatus.color} border`}>
625
+ {turmaStatus.label}
621
626
  </Badge>
622
627
  </div>
623
628
  <p className="text-muted-foreground">
@@ -61,7 +61,7 @@ import {
61
61
  } from '@dnd-kit/sortable';
62
62
  import { CSS } from '@dnd-kit/utilities';
63
63
  import { zodResolver } from '@hookform/resolvers/zod';
64
- import { AnimatePresence, motion } from 'framer-motion';
64
+ import { AnimatePresence, motion, type Variants } from 'framer-motion';
65
65
  import {
66
66
  AlertTriangle,
67
67
  Archive,
@@ -579,7 +579,7 @@ const initialAulas: Aula[] = [
579
579
  // ── Animations ──────────────────────────────────────────────────────────────
580
580
 
581
581
  const stagger = { hidden: {}, show: { transition: { staggerChildren: 0.04 } } };
582
- const fadeUp = {
582
+ const fadeUp: Variants = {
583
583
  hidden: { opacity: 0, y: 12 },
584
584
  show: { opacity: 1, y: 0, transition: { duration: 0.3, ease: 'easeOut' } },
585
585
  };
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { Page, PageHeader } from '@/components/entity-list';
3
+ import { EmptyState, Page, PageHeader } from '@/components/entity-list';
4
4
  import { Badge } from '@/components/ui/badge';
5
5
  import { Button } from '@/components/ui/button';
6
6
  import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
@@ -265,6 +265,29 @@ export default function TentativaPage() {
265
265
  const answeredCount = Object.keys(answers).length;
266
266
  const progressPercent = (answeredCount / examQuestions.length) * 100;
267
267
 
268
+ if (!currentQuestion) {
269
+ return (
270
+ <Page>
271
+ <PageHeader
272
+ title={EXAM_TITLE}
273
+ breadcrumbs={[
274
+ { label: t('breadcrumbs.home'), href: '/' },
275
+ { label: t('breadcrumbs.exams'), href: '/lms/exams' },
276
+ { label: t('breadcrumbs.current') },
277
+ ]}
278
+ />
279
+ <Card>
280
+ <CardContent className="p-6 text-center">
281
+ <p className="text-base font-semibold">{t('empty.title')}</p>
282
+ <p className="mt-2 text-sm text-muted-foreground">
283
+ {t('empty.description')}
284
+ </p>
285
+ </CardContent>
286
+ </Card>
287
+ </Page>
288
+ );
289
+ }
290
+
268
291
  function formatTime(seconds: number) {
269
292
  const h = Math.floor(seconds / 3600);
270
293
  const m = Math.floor((seconds % 3600) / 60);
@@ -738,8 +761,7 @@ export default function TentativaPage() {
738
761
  </Button>
739
762
  <Button
740
763
  variant="ghost"
741
- className={`shrink-0 ${flagged.has(currentQuestion.id) ? 'text-primary' : 'text-muted-foreground'}`}
742
- className="lg:hidden"
764
+ className={`shrink-0 lg:hidden ${flagged.has(currentQuestion.id) ? 'text-primary' : 'text-muted-foreground'}`}
743
765
  onClick={() => setShowNav(!showNav)}
744
766
  >
745
767
  {currentIndex + 1}/{examQuestions.length}
@@ -31,7 +31,7 @@ import {
31
31
  startOfWeek,
32
32
  } from 'date-fns';
33
33
  import { ptBR } from 'date-fns/locale/pt-BR';
34
- import { motion } from 'framer-motion';
34
+ import { motion, type Variants } from 'framer-motion';
35
35
  import {
36
36
  Award,
37
37
  BarChart3,
@@ -163,7 +163,7 @@ function genCalendarEvents() {
163
163
  if (dayOfWeek === 0 || dayOfWeek === 6) continue;
164
164
  const numAulas = dayOfWeek % 2 === 0 ? 3 : 2;
165
165
  for (let a = 0; a < numAulas; a++) {
166
- const turma = turmas[(d + 14 + a) % turmas.length];
166
+ const turma = turmas[(d + 14 + a) % turmas.length]!;
167
167
  const horaInicio = 8 + a * 3;
168
168
  events.push({
169
169
  title: turma.nome,
@@ -394,7 +394,7 @@ const stagger = {
394
394
  show: { transition: { staggerChildren: 0.08 } },
395
395
  };
396
396
 
397
- const fadeUp = {
397
+ const fadeUp: Variants = {
398
398
  hidden: { opacity: 0, y: 16 },
399
399
  show: { opacity: 1, y: 0, transition: { duration: 0.35, ease: 'easeOut' } },
400
400
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hed-hog/lms",
3
- "version": "0.0.285",
3
+ "version": "0.0.286",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
@@ -9,15 +9,15 @@
9
9
  "@nestjs/core": "^11",
10
10
  "@nestjs/jwt": "^11",
11
11
  "@nestjs/mapped-types": "*",
12
+ "@hed-hog/api": "0.0.4",
13
+ "@hed-hog/core": "0.0.286",
14
+ "@hed-hog/contact": "0.0.286",
12
15
  "@hed-hog/api-pagination": "0.0.6",
13
- "@hed-hog/contact": "0.0.285",
14
16
  "@hed-hog/api-prisma": "0.0.5",
15
- "@hed-hog/core": "0.0.285",
17
+ "@hed-hog/finance": "0.0.286",
16
18
  "@hed-hog/api-types": "0.0.1",
17
19
  "@hed-hog/api-locale": "0.0.13",
18
- "@hed-hog/finance": "0.0.285",
19
- "@hed-hog/api": "0.0.4",
20
- "@hed-hog/category": "0.0.285"
20
+ "@hed-hog/category": "0.0.286"
21
21
  },
22
22
  "exports": {
23
23
  ".": {