|
1 | | -import React, { useMemo } from 'react' |
| 1 | +import BCTypography from '@/components/BCTypography/index.jsx' |
| 2 | +import { StyledListItem } from '@/components/StyledListItem.jsx' |
| 3 | +import { COMPLIANCE_REPORT_STATUSES } from '@/constants/statuses.js' |
| 4 | +import { useCurrentUser } from '@/hooks/useCurrentUser.js' |
| 5 | +import { timezoneFormatter } from '@/utils/formatters.js' |
| 6 | +import { ExpandMore } from '@mui/icons-material' |
2 | 7 | import { List, ListItemText, styled } from '@mui/material' |
3 | 8 | import MuiAccordion from '@mui/material/Accordion' |
| 9 | +import MuiAccordionDetails from '@mui/material/AccordionDetails' |
4 | 10 | import MuiAccordionSummary, { |
5 | 11 | accordionSummaryClasses |
6 | 12 | } from '@mui/material/AccordionSummary' |
7 | | -import MuiAccordionDetails from '@mui/material/AccordionDetails' |
8 | | -import { useCurrentUser } from '@/hooks/useCurrentUser.js' |
| 13 | +import { useMemo } from 'react' |
9 | 14 | import { useTranslation } from 'react-i18next' |
10 | | -import { COMPLIANCE_REPORT_STATUSES } from '@/constants/statuses.js' |
11 | | -import BCTypography from '@/components/BCTypography/index.jsx' |
12 | | -import { StyledListItem } from '@/components/StyledListItem.jsx' |
13 | | -import { timezoneFormatter } from '@/utils/formatters.js' |
14 | | -import { ExpandMore } from '@mui/icons-material' |
15 | 15 |
|
16 | 16 | const Accordion = styled((props) => ( |
17 | 17 | <MuiAccordion disableGutters elevation={0} square {...props} /> |
@@ -85,6 +85,22 @@ export const HistoryCard = ({ report, defaultExpanded = false }) => { |
85 | 85 | {filteredHistory.length > 0 && ( |
86 | 86 | <AccordionDetails> |
87 | 87 | <List> |
| 88 | + {report.assessmentStatement && |
| 89 | + ((!isGovernmentUser && |
| 90 | + report.currentStatus.status === 'Assessed') || |
| 91 | + isGovernmentUser) && ( |
| 92 | + <StyledListItem disablePadding> |
| 93 | + <ListItemText |
| 94 | + data-test="list-item" |
| 95 | + primaryTypographyProps={{ variant: 'body4' }} |
| 96 | + > |
| 97 | + <strong> |
| 98 | + {t('report:complianceReportHistory.directorStatement')}: |
| 99 | + </strong>{' '} |
| 100 | + {report.assessmentStatement} |
| 101 | + </ListItemText> |
| 102 | + </StyledListItem> |
| 103 | + )} |
88 | 104 | {filteredHistory.map((item, index) => ( |
89 | 105 | <StyledListItem key={index} disablePadding> |
90 | 106 | <ListItemText |
@@ -146,21 +162,6 @@ export const HistoryCard = ({ report, defaultExpanded = false }) => { |
146 | 162 | })} |
147 | 163 | </ListItemText> |
148 | 164 | </StyledListItem> |
149 | | - {report.assessmentStatement && ( |
150 | | - <StyledListItem disablePadding> |
151 | | - <ListItemText |
152 | | - primaryTypographyProps={{ variant: 'body4' }} |
153 | | - > |
154 | | - <strong> |
155 | | - {t( |
156 | | - 'report:complianceReportHistory.directorStatement' |
157 | | - )} |
158 | | - : |
159 | | - </strong> |
160 | | - {report.assessmentStatement} |
161 | | - </ListItemText> |
162 | | - </StyledListItem> |
163 | | - )} |
164 | 165 | </List> |
165 | 166 | )} |
166 | 167 | </StyledListItem> |
|
0 commit comments