@granto-umbrella/umbrella-components 3.0.34 → 3.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +165 -27
- package/dist/umbrella-components.css +1 -1
- package/dist/umbrella-components.es.js +33627 -28792
- package/dist/umbrella-components.umd.js +1169 -1908
- package/package.json +136 -106
- package/src/assets.d.ts +19 -19
- package/src/components/atoms/Badge/Badge.styles.ts +88 -86
- package/src/components/atoms/Badge/Badge.tsx +42 -44
- package/src/components/atoms/Badge/Badge.types.ts +15 -15
- package/src/components/atoms/Breadcrumb/Breadcrumb.styles.ts +43 -43
- package/src/components/atoms/Breadcrumb/Breadcrumb.tsx +46 -48
- package/src/components/atoms/Breadcrumb/Breadcrumb.types.ts +12 -12
- package/src/components/atoms/Button/Button.styles.ts +279 -280
- package/src/components/atoms/Button/Button.tsx +76 -76
- package/src/components/atoms/Button/Button.types.ts +28 -28
- package/src/components/atoms/Button/index.ts +1 -1
- package/src/components/atoms/Checkbox/Checkbox.styles.ts +72 -72
- package/src/components/atoms/Checkbox/Checkbox.tsx +36 -36
- package/src/components/atoms/Checkbox/Checkbox.types.ts +14 -14
- package/src/components/atoms/Checkbox/CheckboxGroup.tsx +30 -30
- package/src/components/atoms/Checkbox/CheckboxSelectAll.tsx +32 -32
- package/src/components/atoms/CodeInput/CodeInput.styles.tsx +38 -39
- package/src/components/atoms/CodeInput/CodeInput.tsx +13 -19
- package/src/components/atoms/CodeInput/CodeInput.types.ts +3 -3
- package/src/components/atoms/CodeInput/index.tsx +1 -1
- package/src/components/atoms/DropDownMenu/DropdownMenu.tsx +48 -48
- package/src/components/atoms/DropDownMenu/DropdownMenu.types.ts +15 -15
- package/src/components/atoms/DropDownMenu/index.tsx +5 -2
- package/src/components/atoms/ErrorMessage/ErrorMessage.styles.tsx +28 -28
- package/src/components/atoms/ErrorMessage/ErrorMessage.tsx +12 -12
- package/src/components/atoms/ErrorMessage/ErrorMessage.types.ts +6 -6
- package/src/components/atoms/ErrorMessage/index.tsx +1 -1
- package/src/components/atoms/Footer/Footer.styles.tsx +22 -22
- package/src/components/atoms/Footer/Footer.tsx +9 -9
- package/src/components/atoms/Footer/Footer.types.tsx +5 -5
- package/src/components/atoms/Footer/index.tsx +1 -1
- package/src/components/atoms/GenericContainer/GenericContainer.styles.tsx +21 -21
- package/src/components/atoms/GenericContainer/GenericContainer.tsx +9 -9
- package/src/components/atoms/GenericContainer/GenericContainer.types.ts +5 -5
- package/src/components/atoms/GenericContainer/index.tsx +1 -1
- package/src/components/atoms/Icon/Icon.styles.ts +11 -11
- package/src/components/atoms/Icon/Icon.tsx +22 -22
- package/src/components/atoms/Icon/Icon.types.ts +6 -6
- package/src/components/atoms/Icon/index.ts +1 -1
- package/src/components/atoms/Input/Input.styles.ts +106 -101
- package/src/components/atoms/Input/index.ts +1 -1
- package/src/components/atoms/Label/Label.tsx +16 -16
- package/src/components/atoms/Loading/Loading.styles.tsx +25 -25
- package/src/components/atoms/Loading/Loading.tsx +8 -8
- package/src/components/atoms/LogoContainer/LogoContainer.Types.tsx +5 -5
- package/src/components/atoms/LogoContainer/LogoContainer.styles.tsx +11 -11
- package/src/components/atoms/LogoContainer/LogoContainer.tsx +11 -11
- package/src/components/atoms/LogoContainer/index.tsx +1 -1
- package/src/components/atoms/ModalAviso/ModalAviso.styles.tsx +56 -56
- package/src/components/atoms/ModalAviso/ModalAviso.tsx +43 -37
- package/src/components/atoms/ModalAviso/ModalAviso.types.ts +5 -5
- package/src/components/atoms/ModalAviso/index.tsx +1 -1
- package/src/components/atoms/MultiSelect/MultiSelect.styles.tsx +100 -92
- package/src/components/atoms/MultiSelect/MultiSelect.tsx +346 -346
- package/src/components/atoms/MultiSelect/MultiSelect.types.ts +38 -38
- package/src/components/atoms/Pill/Pill.styles.ts +46 -46
- package/src/components/atoms/Pill/Pill.tsx +35 -36
- package/src/components/atoms/Pill/Pill.types.ts +14 -18
- package/src/components/atoms/RadioButton/RadioButton.styles.ts +44 -43
- package/src/components/atoms/RadioButton/RadioButton.tsx +31 -31
- package/src/components/atoms/ResendLink/ResendLink.styles.tsx +19 -20
- package/src/components/atoms/ResendLink/ResendLink.tsx +21 -21
- package/src/components/atoms/ResendLink/ResendLink.types.ts +8 -9
- package/src/components/atoms/ResendLink/index.tsx +1 -2
- package/src/components/atoms/Select/Select.styles.ts +153 -149
- package/src/components/atoms/Select/Select.tsx +52 -43
- package/src/components/atoms/Select/index.tsx +1 -1
- package/src/components/atoms/Subtitle/Subtitle.tsx +7 -7
- package/src/components/atoms/Subtitle/Subtitle.types.ts +5 -5
- package/src/components/atoms/Subtitle/index.tsx +1 -1
- package/src/components/atoms/Switch/Switch.tsx +25 -25
- package/src/components/atoms/TabBar/TabBar.styles.tsx +64 -57
- package/src/components/atoms/TabBar/index.tsx +2 -2
- package/src/components/atoms/Text/Text.styles.tsx +35 -35
- package/src/components/atoms/Text/Text.tsx +32 -31
- package/src/components/atoms/Text/Text.types.ts +8 -8
- package/src/components/atoms/Text/index.ts +1 -1
- package/src/components/atoms/Textarea/Textarea.styles.ts +52 -52
- package/src/components/atoms/Textarea/Textarea.tsx +31 -31
- package/src/components/atoms/Title/Title.tsx +7 -7
- package/src/components/atoms/Title/Title.types.ts +5 -5
- package/src/components/atoms/Title/index.tsx +1 -1
- package/src/components/molecules/BannerAjuda/BannerAjuda.styles.tsx +9 -9
- package/src/components/molecules/BannerAjuda/BannerAjuda.tsx +18 -19
- package/src/components/molecules/BannerAjuda/index.tsx +1 -1
- package/src/components/molecules/ButtonGroup/ButtonGroup.styles.ts +10 -10
- package/src/components/molecules/ButtonGroup/ButtonGroup.types.ts +22 -22
- package/src/components/molecules/Calendar/Calendar.styles.ts +143 -143
- package/src/components/molecules/Calendar/Calendar.tsx +31 -31
- package/src/components/molecules/CodeInputContainer/CodeInputContainer.styles.tsx +7 -7
- package/src/components/molecules/CodeInputContainer/CodeInputContainer.types.ts +13 -13
- package/src/components/molecules/CodeInputContainer/index.tsx +1 -3
- package/src/components/molecules/ExcludeModal/ExcludeModal.styles.tsx +123 -118
- package/src/components/molecules/ExcludeModal/ExcludeModal.tsx +48 -48
- package/src/components/molecules/ExcludeModal/ExcludeModal.types.ts +10 -10
- package/src/components/molecules/ExcludeModal/index.tsx +1 -1
- package/src/components/molecules/FieldSelector/FieldSelector.styles.ts +59 -0
- package/src/components/molecules/FieldSelector/FieldSelector.tsx +167 -0
- package/src/components/molecules/HighlightsCard/HighlightsCard.styles.tsx +67 -68
- package/src/components/molecules/HighlightsCard/HighlightsCard.tsx +35 -26
- package/src/components/molecules/HighlightsCard/HighlightsCard.types.ts +10 -10
- package/src/components/molecules/HighlightsCard/index.tsx +1 -1
- package/src/components/molecules/InsuranceCard/InsuranceCard.styles.tsx +237 -237
- package/src/components/molecules/InsuranceCard/index.tsx +1 -1
- package/src/components/molecules/PieChartComponent/PieChartComponent.styles.tsx +7 -8
- package/src/components/molecules/PieChartComponent/PieChartComponent.tsx +70 -73
- package/src/components/molecules/PieChartComponent/PieChartComponent.types.ts +11 -11
- package/src/components/molecules/PieChartComponent/index.tsx +1 -1
- package/src/components/molecules/Popover/Popover.styles.ts +66 -65
- package/src/components/molecules/Popover/Popover.tsx +23 -23
- package/src/components/molecules/RadioBoxGroup/RadioBoxGroup.styles.ts +11 -11
- package/src/components/molecules/RadioBoxGroup/RadioBoxGroup.tsx +43 -43
- package/src/components/molecules/RadioGroupField/RadioGroupField.styles.tsx +65 -64
- package/src/components/molecules/RadioGroupField/RadioGroupField.tsx +69 -69
- package/src/components/molecules/RadioGroupField/RadioGroupField.types.ts +17 -17
- package/src/components/molecules/RadioGroupField/index.tsx +1 -1
- package/src/components/molecules/RefuseModal/RefuseModal.styles.tsx +139 -139
- package/src/components/molecules/RefuseModal/RefuseModal.tsx +92 -76
- package/src/components/molecules/RefuseModal/RefuseModal.types.ts +15 -15
- package/src/components/molecules/RefuseModal/index.tsx +2 -2
- package/src/components/molecules/ResultsChart/ResultsChart.tsx +23 -19
- package/src/components/molecules/ResultsChart/ResultsChart.types.ts +3 -3
- package/src/components/molecules/ResultsChart/index.tsx +2 -2
- package/src/components/molecules/TabToggle/TabToggle.styles.ts +54 -54
- package/src/components/molecules/TabToggle/TabToggle.tsx +35 -35
- package/src/components/organisms/AlertDialog/AlertDialog.styles.tsx +61 -61
- package/src/components/organisms/AlertDialog/AlertDialog.tsx +70 -70
- package/src/components/organisms/Dialog/Dialog.styles.ts +107 -106
- package/src/components/organisms/Dialog/Dialog.tsx +69 -69
- package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.styles.tsx +113 -113
- package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.tsx +75 -71
- package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.types.ts +9 -9
- package/src/components/organisms/DonutEmissionsChart/index.tsx +5 -2
- package/src/components/organisms/ExportExcelModal/ExportExcelModal.styles.ts +59 -0
- package/src/components/organisms/ExportExcelModal/ExportExcelModal.tsx +80 -0
- package/src/components/organisms/Form/Form.styles.ts +35 -35
- package/src/components/organisms/Form/Form.tsx +160 -160
- package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.styles.tsx +115 -114
- package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.tsx +89 -89
- package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.types.ts +16 -16
- package/src/components/organisms/ListagemUltimasEmissoes/index.tsx +1 -1
- package/src/components/organisms/Navbar/Navbar.styles.tsx +243 -243
- package/src/global.d.ts +9 -9
- package/src/index.ts +4 -0
- package/src/lib/utils.ts +6 -6
- package/src/styles/tokens/borders.ts +17 -17
- package/src/styles/tokens/index.tsx +6 -6
- package/src/styles/tokens/radius.ts +22 -22
- package/src/styles/tokens/shadows.ts +22 -22
- package/src/styles/tokens/sizes.ts +60 -64
- package/src/types/radius.types.ts +1 -1
- package/src/types/shadows.types.ts +1 -1
- package/src/utils/renderHighlightsCard.tsx +21 -0
|
@@ -1,114 +1,115 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import {
|
|
3
|
-
semanticColors,
|
|
4
|
-
semanticSizes,
|
|
5
|
-
typographyTokens,
|
|
6
|
-
semanticRadius,
|
|
7
|
-
} from
|
|
8
|
-
|
|
9
|
-
export const TableWrapper = styled.div`
|
|
10
|
-
width: 100%;
|
|
11
|
-
overflow-x: auto;
|
|
12
|
-
background-color: ${semanticColors.base.background};
|
|
13
|
-
border: 1px solid ${semanticColors.global.border.default};
|
|
14
|
-
padding: ${semanticSizes.global.padding.xl};
|
|
15
|
-
border-radius: ${semanticRadius.global.radius.md2};
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
export const Table = styled.table`
|
|
19
|
-
width: 100%;
|
|
20
|
-
border-collapse: collapse;
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
export const TableHead = styled.thead`
|
|
24
|
-
background-color: ${semanticColors.base.background};
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
export const TableRow = styled.tr`
|
|
28
|
-
&:last-child td {
|
|
29
|
-
border-bottom: none;
|
|
30
|
-
padding-bottom: 0;
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
|
-
export const TableHeader = styled.th`
|
|
35
|
-
padding: ${semanticSizes.global.padding.md} 0;
|
|
36
|
-
text-align: left;
|
|
37
|
-
border: 0px;
|
|
38
|
-
font-weight: ${typographyTokens.fontWeights.semibold};
|
|
39
|
-
font-size: ${typographyTokens.fontSizes.bodyS};
|
|
40
|
-
color: ${semanticColors.global.text.onSurface.enabled};
|
|
41
|
-
|
|
42
|
-
&.center {
|
|
43
|
-
text-align: center;
|
|
44
|
-
}
|
|
45
|
-
`;
|
|
46
|
-
|
|
47
|
-
export const TableData = styled.td`
|
|
48
|
-
padding: ${semanticSizes.global.padding.lg} 0
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
font-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import {
|
|
3
|
+
semanticColors,
|
|
4
|
+
semanticSizes,
|
|
5
|
+
typographyTokens,
|
|
6
|
+
semanticRadius,
|
|
7
|
+
} from '../../../styles/tokens';
|
|
8
|
+
|
|
9
|
+
export const TableWrapper = styled.div`
|
|
10
|
+
width: 100%;
|
|
11
|
+
overflow-x: auto;
|
|
12
|
+
background-color: ${semanticColors.base.background};
|
|
13
|
+
border: 1px solid ${semanticColors.global.border.default};
|
|
14
|
+
padding: ${semanticSizes.global.padding.xl};
|
|
15
|
+
border-radius: ${semanticRadius.global.radius.md2};
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
export const Table = styled.table`
|
|
19
|
+
width: 100%;
|
|
20
|
+
border-collapse: collapse;
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
export const TableHead = styled.thead`
|
|
24
|
+
background-color: ${semanticColors.base.background};
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const TableRow = styled.tr`
|
|
28
|
+
&:last-child td {
|
|
29
|
+
border-bottom: none;
|
|
30
|
+
padding-bottom: 0;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
export const TableHeader = styled.th`
|
|
35
|
+
padding: ${semanticSizes.global.padding.md} 0;
|
|
36
|
+
text-align: left;
|
|
37
|
+
border: 0px;
|
|
38
|
+
font-weight: ${typographyTokens.fontWeights.semibold};
|
|
39
|
+
font-size: ${typographyTokens.fontSizes.bodyS};
|
|
40
|
+
color: ${semanticColors.global.text.onSurface.enabled};
|
|
41
|
+
|
|
42
|
+
&.center {
|
|
43
|
+
text-align: center;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
export const TableData = styled.td`
|
|
48
|
+
padding: ${semanticSizes.global.padding.lg} 0
|
|
49
|
+
${semanticSizes.global.padding['2xl']};
|
|
50
|
+
border-bottom: 1px solid ${semanticColors.neutral[200]};
|
|
51
|
+
text-align: left;
|
|
52
|
+
font-size: ${typographyTokens.fontSizes.bodyM};
|
|
53
|
+
color: ${semanticColors.global.text.default.enabled};
|
|
54
|
+
|
|
55
|
+
&.center {
|
|
56
|
+
text-align: center;
|
|
57
|
+
|
|
58
|
+
img {
|
|
59
|
+
display: block;
|
|
60
|
+
margin: 0 auto;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
img {
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
export const TableWrapperHeader = styled.div`
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: row;
|
|
72
|
+
justify-content: space-between;
|
|
73
|
+
align-items: center;
|
|
74
|
+
gap: ${semanticSizes.global.gap.sm};
|
|
75
|
+
margin-bottom: ${semanticSizes.global.gap.lg};
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
export const TableWrapperTitle = styled.h2`
|
|
79
|
+
font-size: ${typographyTokens.fontSizes.headingM};
|
|
80
|
+
font-weight: ${typographyTokens.fontWeights.medium};
|
|
81
|
+
margin: 0;
|
|
82
|
+
color: ${semanticColors.base.text};
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
export const TableWrapperLink = styled.button`
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: row;
|
|
88
|
+
font-size: ${typographyTokens.fontSizes.labelL};
|
|
89
|
+
margin: 0;
|
|
90
|
+
padding: 0;
|
|
91
|
+
background: none;
|
|
92
|
+
border: none;
|
|
93
|
+
color: ${semanticColors.branding.text.accent.enabled};
|
|
94
|
+
gap: ${semanticSizes.global.gap.sm};
|
|
95
|
+
align-items: center;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
transition: opacity 0.2s;
|
|
98
|
+
|
|
99
|
+
&:hover {
|
|
100
|
+
opacity: 0.8;
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
103
|
+
|
|
104
|
+
export const LoadingContainer = styled.div`
|
|
105
|
+
display: flex;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
align-items: center;
|
|
108
|
+
padding: ${semanticSizes.global.padding['3xl']};
|
|
109
|
+
font-size: ${typographyTokens.fontSizes.bodyM};
|
|
110
|
+
color: ${semanticColors.global.text.onSurface.subtitle};
|
|
111
|
+
`;
|
|
112
|
+
|
|
113
|
+
export const ErrorContainer = styled(LoadingContainer)`
|
|
114
|
+
color: ${semanticColors.danger.text.feedback.strong};
|
|
115
|
+
`;
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import {
|
|
3
|
-
TableWrapper,
|
|
4
|
-
Table,
|
|
5
|
-
TableHead,
|
|
6
|
-
TableRow,
|
|
7
|
-
TableHeader,
|
|
8
|
-
TableData,
|
|
9
|
-
TableWrapperHeader,
|
|
10
|
-
TableWrapperTitle,
|
|
11
|
-
TableWrapperLink,
|
|
12
|
-
LoadingContainer,
|
|
13
|
-
ErrorContainer,
|
|
14
|
-
} from
|
|
15
|
-
import { ListagemUltimasEmissoesProps } from
|
|
16
|
-
|
|
17
|
-
const ListagemUltimasEmissoes: React.FC<ListagemUltimasEmissoesProps> = ({
|
|
18
|
-
items = [],
|
|
19
|
-
isLoading = false,
|
|
20
|
-
isError = false,
|
|
21
|
-
error = null,
|
|
22
|
-
onViewAll,
|
|
23
|
-
onActionClick,
|
|
24
|
-
title =
|
|
25
|
-
}) => {
|
|
26
|
-
if (isLoading) {
|
|
27
|
-
return <LoadingContainer>Carregando emissões...</LoadingContainer>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (isError) {
|
|
31
|
-
return (
|
|
32
|
-
<ErrorContainer>
|
|
33
|
-
Erro: {error?.message ||
|
|
34
|
-
</ErrorContainer>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (!items || items.length === 0) {
|
|
39
|
-
return <LoadingContainer>Nenhuma emissão encontrada</LoadingContainer>;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<TableWrapper>
|
|
44
|
-
<TableWrapperHeader>
|
|
45
|
-
<TableWrapperTitle>{title}</TableWrapperTitle>
|
|
46
|
-
<TableWrapperLink onClick={onViewAll}>
|
|
47
|
-
Ver todos
|
|
48
|
-
<span>→</span>
|
|
49
|
-
</TableWrapperLink>
|
|
50
|
-
</TableWrapperHeader>
|
|
51
|
-
|
|
52
|
-
<Table>
|
|
53
|
-
<TableHead>
|
|
54
|
-
<TableRow>
|
|
55
|
-
<TableHeader>Reclamante</TableHeader>
|
|
56
|
-
<TableHeader>Valor Pago</TableHeader>
|
|
57
|
-
<TableHeader>Produto</TableHeader>
|
|
58
|
-
<TableHeader>ID</TableHeader>
|
|
59
|
-
<TableHeader className="center">Ações</TableHeader>
|
|
60
|
-
</TableRow>
|
|
61
|
-
</TableHead>
|
|
62
|
-
<tbody>
|
|
63
|
-
{items.map((item) => (
|
|
64
|
-
<TableRow key={item.policyId}>
|
|
65
|
-
<TableData>{item.insurerName}</TableData>
|
|
66
|
-
<TableData>
|
|
67
|
-
{Number(item.paymentTotal).toLocaleString(
|
|
68
|
-
style:
|
|
69
|
-
currency:
|
|
70
|
-
})}
|
|
71
|
-
</TableData>
|
|
72
|
-
<TableData>{item.modality}</TableData>
|
|
73
|
-
<TableData>{item.policyId}</TableData>
|
|
74
|
-
<TableData
|
|
75
|
-
className="center"
|
|
76
|
-
onClick={() => onActionClick?.(item.policyId)}
|
|
77
|
-
style={{ cursor:
|
|
78
|
-
>
|
|
79
|
-
⋮
|
|
80
|
-
</TableData>
|
|
81
|
-
</TableRow>
|
|
82
|
-
))}
|
|
83
|
-
</tbody>
|
|
84
|
-
</Table>
|
|
85
|
-
</TableWrapper>
|
|
86
|
-
);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export { ListagemUltimasEmissoes };
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
TableWrapper,
|
|
4
|
+
Table,
|
|
5
|
+
TableHead,
|
|
6
|
+
TableRow,
|
|
7
|
+
TableHeader,
|
|
8
|
+
TableData,
|
|
9
|
+
TableWrapperHeader,
|
|
10
|
+
TableWrapperTitle,
|
|
11
|
+
TableWrapperLink,
|
|
12
|
+
LoadingContainer,
|
|
13
|
+
ErrorContainer,
|
|
14
|
+
} from './ListagemUltimasEmissoes.styles';
|
|
15
|
+
import { ListagemUltimasEmissoesProps } from './ListagemUltimasEmissoes.types';
|
|
16
|
+
|
|
17
|
+
const ListagemUltimasEmissoes: React.FC<ListagemUltimasEmissoesProps> = ({
|
|
18
|
+
items = [],
|
|
19
|
+
isLoading = false,
|
|
20
|
+
isError = false,
|
|
21
|
+
error = null,
|
|
22
|
+
onViewAll,
|
|
23
|
+
onActionClick,
|
|
24
|
+
title = 'Suas últimas emissões',
|
|
25
|
+
}) => {
|
|
26
|
+
if (isLoading) {
|
|
27
|
+
return <LoadingContainer>Carregando emissões...</LoadingContainer>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (isError) {
|
|
31
|
+
return (
|
|
32
|
+
<ErrorContainer>
|
|
33
|
+
Erro: {error?.message || 'Não foi possível carregar as emissões'}
|
|
34
|
+
</ErrorContainer>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!items || items.length === 0) {
|
|
39
|
+
return <LoadingContainer>Nenhuma emissão encontrada</LoadingContainer>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<TableWrapper>
|
|
44
|
+
<TableWrapperHeader>
|
|
45
|
+
<TableWrapperTitle>{title}</TableWrapperTitle>
|
|
46
|
+
<TableWrapperLink onClick={onViewAll}>
|
|
47
|
+
Ver todos
|
|
48
|
+
<span>→</span>
|
|
49
|
+
</TableWrapperLink>
|
|
50
|
+
</TableWrapperHeader>
|
|
51
|
+
|
|
52
|
+
<Table>
|
|
53
|
+
<TableHead>
|
|
54
|
+
<TableRow>
|
|
55
|
+
<TableHeader>Reclamante</TableHeader>
|
|
56
|
+
<TableHeader>Valor Pago</TableHeader>
|
|
57
|
+
<TableHeader>Produto</TableHeader>
|
|
58
|
+
<TableHeader>ID</TableHeader>
|
|
59
|
+
<TableHeader className="center">Ações</TableHeader>
|
|
60
|
+
</TableRow>
|
|
61
|
+
</TableHead>
|
|
62
|
+
<tbody>
|
|
63
|
+
{items.map((item) => (
|
|
64
|
+
<TableRow key={item.policyId}>
|
|
65
|
+
<TableData>{item.insurerName}</TableData>
|
|
66
|
+
<TableData>
|
|
67
|
+
{Number(item.paymentTotal).toLocaleString('pt-BR', {
|
|
68
|
+
style: 'currency',
|
|
69
|
+
currency: 'BRL',
|
|
70
|
+
})}
|
|
71
|
+
</TableData>
|
|
72
|
+
<TableData>{item.modality}</TableData>
|
|
73
|
+
<TableData>{item.policyId}</TableData>
|
|
74
|
+
<TableData
|
|
75
|
+
className="center"
|
|
76
|
+
onClick={() => onActionClick?.(item.policyId)}
|
|
77
|
+
style={{ cursor: 'pointer' }}
|
|
78
|
+
>
|
|
79
|
+
⋮
|
|
80
|
+
</TableData>
|
|
81
|
+
</TableRow>
|
|
82
|
+
))}
|
|
83
|
+
</tbody>
|
|
84
|
+
</Table>
|
|
85
|
+
</TableWrapper>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export { ListagemUltimasEmissoes };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export interface EmissionItem {
|
|
2
|
-
policyId: string;
|
|
3
|
-
insurerName: string;
|
|
4
|
-
paymentTotal: number;
|
|
5
|
-
modality: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface ListagemUltimasEmissoesProps {
|
|
9
|
-
items?: EmissionItem[];
|
|
10
|
-
isLoading?: boolean;
|
|
11
|
-
isError?: boolean;
|
|
12
|
-
error?: Error | null;
|
|
13
|
-
onViewAll?: () => void;
|
|
14
|
-
onActionClick?: (policyId: string) => void;
|
|
15
|
-
title?: string;
|
|
16
|
-
}
|
|
1
|
+
export interface EmissionItem {
|
|
2
|
+
policyId: string;
|
|
3
|
+
insurerName: string;
|
|
4
|
+
paymentTotal: number;
|
|
5
|
+
modality: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ListagemUltimasEmissoesProps {
|
|
9
|
+
items?: EmissionItem[];
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
isError?: boolean;
|
|
12
|
+
error?: Error | null;
|
|
13
|
+
onViewAll?: () => void;
|
|
14
|
+
onActionClick?: (policyId: string) => void;
|
|
15
|
+
title?: string;
|
|
16
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ListagemUltimasEmissoes } from
|
|
1
|
+
export { ListagemUltimasEmissoes } from './ListagemUltimasEmissoes';
|