@hed-hog/finance 0.0.301 → 0.0.302

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.
@@ -11,23 +11,6 @@
11
11
  - where:
12
12
  slug: admin-finance
13
13
 
14
- - menu_id:
15
- where:
16
- slug: /finance
17
- icon: chart-no-axes-combined
18
- url: /finance
19
- name:
20
- en: Overview
21
- pt: Visão geral
22
- slug: /finance/overview
23
- order: 101
24
- relations:
25
- role:
26
- - where:
27
- slug: admin
28
- - where:
29
- slug: admin-finance
30
-
31
14
  - menu_id:
32
15
  where:
33
16
  slug: /finance
@@ -1,26 +1,26 @@
1
1
  'use client';
2
2
 
3
- 'use client';
4
-
5
- import { FinancePageSection } from '@/app/(app)/(libraries)/finance/_components/finance-layout';
6
- import { Badge } from '@/components/ui/badge';
7
- import { Button } from '@/components/ui/button';
8
- import { EmptyState, Page, PageHeader } from '@/components/entity-list';
9
- import {
10
- Dialog,
11
- DialogContent,
3
+ 'use client';
4
+
5
+ import { FinancePageSection } from '@/app/(app)/(libraries)/finance/_components/finance-layout';
6
+ import { Badge } from '@/components/ui/badge';
7
+ import { Button } from '@/components/ui/button';
8
+ import { EmptyState, Page, PageHeader } from '@/components/entity-list';
9
+ import {
10
+ Dialog,
11
+ DialogContent,
12
12
  DialogDescription,
13
13
  DialogFooter,
14
14
  DialogHeader,
15
15
  DialogTitle,
16
16
  DialogTrigger,
17
- } from '@/components/ui/dialog';
18
- import { KpiCardsGrid } from '@/components/ui/kpi-cards-grid';
19
- import { Label } from '@/components/ui/label';
20
- import { Money } from '@/components/ui/money';
21
- import {
22
- Table,
23
- TableBody,
17
+ } from '@/components/ui/dialog';
18
+ import { KpiCardsGrid } from '@/components/ui/kpi-cards-grid';
19
+ import { Label } from '@/components/ui/label';
20
+ import { Money } from '@/components/ui/money';
21
+ import {
22
+ Table,
23
+ TableBody,
24
24
  TableCell,
25
25
  TableHead,
26
26
  TableHeader,
@@ -207,38 +207,38 @@ export default function AprovacoesPage() {
207
207
  },
208
208
  };
209
209
 
210
- const totalPendente = aprovacoes.reduce((acc, a) => acc + a.valor, 0);
211
- const urgentCount = aprovacoes.filter(
212
- (a) => a.urgencia === 'alta' || a.urgencia === 'critica'
213
- ).length;
214
- const summaryCards = [
215
- {
216
- key: 'pending',
217
- title: t('cards.pending'),
218
- value: aprovacoes.length,
219
- icon: Clock,
220
- layout: 'compact' as const,
221
- },
222
- {
223
- key: 'value',
224
- title: t('cards.totalValue'),
225
- value: <Money value={totalPendente} />,
226
- icon: AlertTriangle,
227
- layout: 'compact' as const,
228
- },
229
- {
230
- key: 'urgent',
231
- title: t('cards.urgent'),
232
- value: urgentCount,
233
- icon: AlertTriangle,
234
- layout: 'compact' as const,
235
- iconContainerClassName: 'bg-orange-500/10 text-orange-700',
236
- accentClassName: 'from-orange-500/20 via-amber-500/10 to-transparent',
237
- },
238
- ];
239
-
240
- return (
241
- <Page>
210
+ const totalPendente = aprovacoes.reduce((acc, a) => acc + a.valor, 0);
211
+ const urgentCount = aprovacoes.filter(
212
+ (a) => a.urgencia === 'alta' || a.urgencia === 'critica'
213
+ ).length;
214
+ const summaryCards = [
215
+ {
216
+ key: 'pending',
217
+ title: t('cards.pending'),
218
+ value: aprovacoes.length,
219
+ icon: Clock,
220
+ layout: 'compact' as const,
221
+ },
222
+ {
223
+ key: 'value',
224
+ title: t('cards.totalValue'),
225
+ value: <Money value={totalPendente} />,
226
+ icon: AlertTriangle,
227
+ layout: 'compact' as const,
228
+ },
229
+ {
230
+ key: 'urgent',
231
+ title: t('cards.urgent'),
232
+ value: urgentCount,
233
+ icon: AlertTriangle,
234
+ layout: 'compact' as const,
235
+ iconContainerClassName: 'bg-orange-500/10 text-orange-700',
236
+ accentClassName: 'from-orange-500/20 via-amber-500/10 to-transparent',
237
+ },
238
+ ];
239
+
240
+ return (
241
+ <Page>
242
242
  <PageHeader
243
243
  title={t('header.title')}
244
244
  description={t('header.description')}
@@ -246,20 +246,17 @@ export default function AprovacoesPage() {
246
246
  { label: t('breadcrumbs.home'), href: '/' },
247
247
  { label: t('breadcrumbs.finance'), href: '/finance' },
248
248
  { label: t('breadcrumbs.current') },
249
- ]}
250
- />
251
-
252
- <KpiCardsGrid items={summaryCards} columns={3} />
253
-
254
- <FinancePageSection
255
- title={t('table.title')}
256
- description={t('table.description')}
257
- >
258
- {aprovacoes.length > 0 ? (
259
- <div className="overflow-x-auto">
260
- <Table>
261
- <TableHeader>
262
- <TableRow>
249
+ ]}
250
+ />
251
+
252
+ <KpiCardsGrid items={summaryCards} columns={3} />
253
+
254
+ <FinancePageSection className="border-none shadow-none p-0">
255
+ {aprovacoes.length > 0 ? (
256
+ <div className="overflow-x-auto">
257
+ <Table>
258
+ <TableHeader>
259
+ <TableRow>
263
260
  <TableHead>{t('table.headers.document')}</TableHead>
264
261
  <TableHead>{t('table.headers.supplier')}</TableHead>
265
262
  <TableHead>{t('table.headers.requester')}</TableHead>
@@ -282,16 +279,16 @@ export default function AprovacoesPage() {
282
279
  const fornecedor = titulo
283
280
  ? getPessoaById(titulo.fornecedorId)
284
281
  : null;
285
- const urgencia =
286
- urgenciaConfig[
287
- aprovacao.urgencia as keyof typeof urgenciaConfig
288
- ] || urgenciaConfig.media;
289
-
290
- return (
291
- <TableRow key={aprovacao.id} className="hover:bg-muted/30">
292
- <TableCell className="font-medium">
293
- {titulo?.documento}
294
- </TableCell>
282
+ const urgencia =
283
+ urgenciaConfig[
284
+ aprovacao.urgencia as keyof typeof urgenciaConfig
285
+ ] || urgenciaConfig.media;
286
+
287
+ return (
288
+ <TableRow key={aprovacao.id} className="hover:bg-muted/30">
289
+ <TableCell className="font-medium">
290
+ {titulo?.documento}
291
+ </TableCell>
295
292
  <TableCell>{fornecedor?.nome}</TableCell>
296
293
  <TableCell>{aprovacao.solicitante}</TableCell>
297
294
  <TableCell className="text-right">
@@ -337,22 +334,22 @@ export default function AprovacoesPage() {
337
334
  </TableCell>
338
335
  </TableRow>
339
336
  );
340
- })}
341
- </TableBody>
342
- </Table>
343
- </div>
344
- ) : (
345
- <div className="px-4 py-8 sm:px-6">
346
- <EmptyState
347
- icon={<CheckCircle className="h-12 w-12" />}
348
- title={t('empty.title')}
349
- description={t('empty.description')}
350
- actionLabel={t('empty.refresh')}
351
- onAction={() => void refetch()}
352
- />
353
- </div>
354
- )}
355
- </FinancePageSection>
356
- </Page>
357
- );
358
- }
337
+ })}
338
+ </TableBody>
339
+ </Table>
340
+ </div>
341
+ ) : (
342
+ <div className="px-4 py-8 sm:px-6">
343
+ <EmptyState
344
+ icon={<CheckCircle className="h-12 w-12" />}
345
+ title={t('empty.title')}
346
+ description={t('empty.description')}
347
+ actionLabel={t('empty.refresh')}
348
+ onAction={() => void refetch()}
349
+ />
350
+ </div>
351
+ )}
352
+ </FinancePageSection>
353
+ </Page>
354
+ );
355
+ }