Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ fragment AdditionalSalaryRequestDetailsFields on AdditionalSalaryRequest {
approvedAt
submittedAt
updatedAt
progressiveApprovalTier {
approver
approvalTimeframe
}
calculations {
currentSalaryCap
staffAccountBalance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ import { currencyFormat } from 'src/lib/intlFormat';
import theme from 'src/theme';
import { StyledListItem } from '../../SavingsFundTransfer/styledComponents/StyledListItem';
import { CompleteFormValues } from '../AdditionalSalaryRequest';
import { useAdditionalSalaryRequest } from '../Shared/AdditionalSalaryRequestContext';

export const CapSubContent: React.FC = () => {
const { t } = useTranslation();
const locale = useLocale();
const currency = 'USD';
const { requestData } = useAdditionalSalaryRequest();
const { approvalTimeframe, approver } =
requestData?.latestAdditionalSalaryRequest?.progressiveApprovalTier ?? {};

const { values } = useFormikContext<CompleteFormValues>();

Expand All @@ -34,14 +38,16 @@ export const CapSubContent: React.FC = () => {
<StyledListItem sx={{ py: 0 }}>
<ListItemText
primary={t(
'For the {{amount}} you are requesting, this will take [time frame] as it needs to be signed off by [approvers].',
'For the {{amount}} you are requesting, this will take {{approvalTimeframe}} as it needs to be signed off by {{approver}}.',
{
amount: currencyFormat(
Number(values.totalAdditionalSalaryRequested),
currency,
locale,
{ showTrailingZeros: true },
),
approvalTimeframe,
approver,
},
)}
primaryTypographyProps={{ variant: 'body2' }}
Expand Down
Loading