Skip to content

Commit

Permalink
fix: add drivers license to profile (#325)
Browse files Browse the repository at this point in the history
Merging without approval
  • Loading branch information
fw-noel authored Jul 10, 2024
1 parent 462f7eb commit a549b2f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions frontend/src/hooks/profileData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ import type { DriverLicense } from '../common/enums/driver-license.enum';
import { DriverLicenseName } from '../common/enums/driver-license.enum';
import { CheckCircleIcon, ExclamationTriangleIcon } from '@heroicons/react/24/solid';

const formatDriversLicenses = (driverLicenses: string[]): string => {
const licensesFormatted = driverLicenses.map(
(l) => DriverLicenseName[l as keyof typeof DriverLicense],
);
return licensesFormatted.join(', ');
};

export const emcrData = (personnel?: Personnel) => {
return {
generalInformation: [
Expand Down Expand Up @@ -47,6 +54,10 @@ export const emcrData = (personnel?: Personnel) => {
? datePST(personnel?.dateApproved as Date)
: '-',
},
{
title: "Driver's License",
content: `${personnel?.driverLicense ? formatDriversLicenses(personnel.driverLicense) : '-'}`,
},
],
contact: [
{
Expand Down Expand Up @@ -83,13 +94,6 @@ export const emcrData = (personnel?: Personnel) => {
};

export const bcwsData = (personnel?: Personnel) => {
const formatDriversLicenses = (driverLicenses: string[]): string => {
const licensesFormatted = driverLicenses.map(
(l) => DriverLicenseName[l as keyof typeof DriverLicense],
);
return licensesFormatted.join(', ');
};

return {
intakeRequirements:
personnel?.status === Status.PENDING
Expand Down

0 comments on commit a549b2f

Please sign in to comment.